Beginners guide on how to configure nameserver in Red Hat, CentOs, Fedora, Debian, Ubuntu or Suse Linux to resolve DNS queries.
Nameserver is the DNS server to which your machine query for name resolutions. This is pretty much important on server facing Internet or having active internet connection or if your system is part of organisation where internal domain name system is implemented for IT Infra. In this article we will walk you through how to setup nameserver in your Linux machine
What is nameserver?
Its server which responds to the queries normally domain name resolution. Its like a phone directory, where you query name and you get phone number. Nameserver receives hostname or domain name in query and responds back with IP address.
This is also a DNS client configuration in Linux. Setting up nameserver and DNS client configuration is one and the same thing.
How to setup nameserver in Red Hat?
You need to open file
/etc/resolv.conf in text editor like
nano and add your name server IP in below format.
For example :
root@kerneltalks # cat /etc/reolv.conf
You can use same above same method to configure nameserver in centOS, debian, Fedora.
How to setup nameserver in Ubuntu?
/etc/resolv.conf file, in ubuntu, you can edit file
/etc/network/interfaces with same above said information. Format remains the same.
root@kerneltalks # cat <em>/etc/network/interfaces</em>
How to configure nameserver in Suse Linux?
If you have access to Suse desktop environment i.e. GUI then you can goto YaST network settings. Navigate to ‘Hostname/DNS‘. Like below :
Here you will be able to add name servers and click Ok to save.
/etc/resolv.conf is way out from command line.