Saturday, April 10, 2010

Linux DNS Client Short notes

Possible Troubleshooting Areas:

1. The 2 configuration files for DNS is /etc/hosts and /etc/resolv.conf. By default, system looks into /etc.hosts files, then looks into /etc/resolv.conf. To change the order, edit the /etc/nsswitch.conf file to:

host: dns,files

2. Any static Name to IP mapping, add into the /etc/hosts file. For e.g the localhost is by default already an entry in the /etc/hosts file.

127.0.0.1      MyclientMachine     localhost.localdomain       localhost

As TCP/IP protocols understands that 127.0.0.1 means the local machine, when you use MyclientMachine, localhost.localdomian or localhost, they all point to the same place, which is 127.0.0.1.

3. Next, you may need to edit the /etc/resolv.conf to include the DNS server you want this machine to point to, so that your machine can resolve other names. The configuration is easy, i'll provide an example here:

#my local network DNS server
nameserver 192.168.1.2
#the next DNS server that I'll depend on if the first one is unreachable or does not resolve the address.
nameserver 202.65.247.31

4. But sometimes, you dont even have to configure /etc/resolv.conf if the DNS settings is provided by your DHCP server when your machine (the DHCP client) is grabbing address, network mask, gateway, its DNS name, the DNS server ips from the DHCP server.

No comments:

Post a Comment