DNS (Domain Name System) translates from a domain name to an IP address.
This usually happens behind the scenes - if you type a domain name like mayfirst.org into your web browser, your webrowser looks up the domain name, translates it into an IP address, queries the server responding to the IP address and then displays the web page - all the while, the actual IP address is hidden from you.
Sometimes, it's useful to manually do a lookup, particularly when you are debugging a problem that might be the result of a lookup failure.
You will need to have binutils installed to run this command. Start by seeing if binutils is installed with:
dpkg -l binutils
If it is not installed, install it:
sudo apt-get install binutils
Once installed, you should have access to the dig command. Try looking up a domain name with:
By default, dig will use the caching DNS servers that your computer is configured to use. If you are curious to see what caching DNS server is being used, type:
Once you query a domain name, that domain name will be in your caching DNS server's cache for as long as the "time to live" record specifies.
0 jamie@animal:~$ dig mayfirst.org ; <<>> DiG 9.8.1-P1 <<>> mayfirst.org ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15700 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;mayfirst.org. IN A ;; ANSWER SECTION: mayfirst.org. 563 IN A 188.8.131.52 ;; Query time: 0 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Sun Aug 26 19:04:06 2012 ;; MSG SIZE rcvd: 46 0 jamie@animal:~$
In the example above, the time to live is "563" - which means 563 seconds. You will have to wait 563 seconds for it to expire from the cache, at which point, your caching DNS server will query the authoritative server for the results.
Supposed I changed the DNS record with the authoritative server (e.g. via the May First/People Link control panel), and I want to see if that change was properly made, but I don't want to wait around for the time to live to expire.
First, find out which servers are the authority for mayfirst.org:
dig -t ns mayfirst.org
Then, using the @ sign, query those servers directly:
dig @a.ns.mayfirst.org mayfirst.org
Notice that the time to live doesn't change when you query the authoritative name server.