Monday, September 20, 2010

Setting up DNS in Ubuntu 10.04 LTS Lucid Lynx

The DNS setup is also a starignt forward job in Ubuntu 10.04 LTS. Like all other major distributions like Redhat Enterprise Linux, Ubuntu distributions also use the /etc/resolv.conf file for DNS resolving.


To cause your machine to consult with a particular server for name lookups you simply add their addresses to /etc/resolv.conf.

Open the /etc/resolv.conf file in your favoirite editor and specify the DNS server in it.

               # sudo vi /etc/resolv.conf
              
              search example.com
              nameserver 192.168.10.1

Here 192.168.10.1 is my DNS server in my example.com domain. Now if your server does not have the file resolv.conf in your /etc directory, dont worry you can simply create it and edit it as above.

       # touch /etc/resolv.conf

Similarly you can assign static lookups in your /etc/hosts file.

             # sudo vi /etc/hosts


             #
 
             192.168.10.100 test test.example.com

If you specify these host explicitely in the /etc/hosts file then the domain name rsolution will takes place fastly.

No comments:

Post a Comment