Hi,
On my Slackware Linux the contents of /etc/resolv.conf list the nameserver(s).
It is refreshed at every boot.
By default mine contains:
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
nameserver 192.168.1.254
# /etc/resolv.conf.tail can replace this line
So my default nameserver is my router @ 192.168.1.254
Just to confuse - I actually modify my /etc/resolv.conf at boot using rc.local.
I update it with other nameservers in a priority order, so that it ends up with:
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
search lan
nameserver 127.0.0.1
nameserver 94.30.127.100
nameserver 89.145.254.78
nameserver 192.168.1.254
# /etc/resolv.conf.tail can replace this line
I'm running dnsmasq locally - also started up via rc.local, so I have a local cacheing nameserver on localhost 127.0.0.1 (if my memory serves me correctly - it was setup ages ago).
I have
dnsmasq -o start
in my rc.local to start my local nameserver after updating the resolv.conf
References (lots more on similar topic if you Google...):
http://www.cyberciti.biz/tips/how-do-i-improve-dns-performance-on-linuxwindows-desktop.htmlhttp://www.debianadmin.com/local-dns-cache-for-faster-browsing-on-ubuntu-system.htmlAlthough I did this setup on Linux, I ran a benchnark using this tool:
http://www.grc.com/dns/benchmark.htmrunning on a Windows Virtual Machine. I could see that after the first access to a URL, subsequent accesses were indeed faster.
The cache of dnsmasq is refreshed at every boot.
dig is an interesting tool for looking at dns performance.
Here's an example of the cacheing in operation when I went to povray.org:
This is the first visit to povray.org today - dns lookup pretty slow:
dig povray.org
; <<>> DiG 9.7.4-P1 <<>> povray.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4507
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0
;; QUESTION SECTION:
;povray.org. IN A
;; ANSWER SECTION:
povray.org. 3600 IN A 203.29.75.48
;; AUTHORITY SECTION:
povray.org. 414 IN NS ns1.povray.org.
povray.org. 414 IN NS ns1.aussie.org.
;; Query time: 2099 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Apr 30 12:06:46 2012
;; MSG SIZE rcvd: 87
On subsequent visits to povray.org - dns lookup is instant thanks to the cache:
dig povray.org
; <<>> DiG 9.7.4-P1 <<>> povray.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15118
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;povray.org. IN A
;; ANSWER SECTION:
povray.org. 3596 IN A 203.29.75.48
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Apr 30 12:06:50 2012
;; MSG SIZE rcvd: 44
Oh, and welcome to Linux...
Cheers,
Peter