What is the best way to query the authoritative DNS server for a domain in PHP?
-
I want to verify that recently changed DNS settings are correct and want to avoid getting incorrect cached values from other DNS servers.
-
Answer:
One approach might be executing something from the command line and parsing the output to see if it's what is expected. Something like this would be a good start: $results = `/usr/bin/dig @http://ns.example.com sub.example.com`; You might need to poke around in the man pages for dig to get exactly what you need, or another utility might work best, but this should get you pretty close.
John David Anderson at Quora Visit the source
Other answers
If you want to query the full "chain" (first the root nameservers, than the TLD nameservers etc), without using any caching, than use dig +trace http://sub.example.com The "trace" option will do exactly that.
Frank Louwers
You might be better off to use one of the existing tools on the net. Try the service of the Swedish ccTLD registry http://dnscheck.iis.se/?time=undefined&id=undefined&test=standard&view=basic&setLanguage=en
Ulrich Wisser
If you want to see what your name servers will return when queried for a specific domain you should query the name servers directly. If you are using Linux or OS X I recommend using dig:Example:digĀ {yourdomain.com} @{yournaemserver}If you are using a Windowns based system you can use nslookupExample:nslookup {http://yourdomain.com.} {yournaemserver}Include the dot at the end of your domain or nslookup will append your local resolver's domain name to the end of your domain.
JR Frazier
Related Q & A:
- What is the best way to distribute an audio/video feed from a computer to TVs over existing indoor coax cable?Best solution by Audio-Video Production
- What's the best way to hook up an overhead projector to a laptop?Best solution by Yahoo! Answers
- What's the best way to get a job in a restaurant?Best solution by Yahoo! Answers
- What's the best way to make a good impression at a job interview?Best solution by Yahoo! Answers
- What is the best way to learn PHP?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.