Nameserver settings in linux

DNS nameserver (DHCLIENT) in linux can be set in two ways:

1. In configure files

  • /etc/dhclient-eth1.conf
  • /etc/dhclient-eth2.conf

for example, a line in one of these files

prepend domain-name-servers,;

this will insert two lines at the beginning of conf file  /etc/resolve.conf

  • nameserver
  • nameserver

This setting is not good for access public wifi point, as the public wifi dns will be appended. When access internet, it will check these name servers first, it will last very long or fails

This approach hurts. In previous version of networkmanager, it is not easy to configure DNS, thus, I added a line in the wireless conf file /etc/dhclient-eth2.conf, soon forget this as new version of networkmanager is well developed. when I attended a conference at overseas, my laptop can connect to the  conference wireless access point very well, with strong signal. Unfortunately, it always picked up the dns nameservers for my home DSL. I  tried around, failed to identify the source file for home dns. This was really annoy. After query the fedora mail list, finally identified the source. That happened when I returned home from the oversea trip. You can imagine, how disappointed I was!!

2. Use of NetworkManager

the current version of NetworkManager handle this well, just follow steps as

  • Right click the network manager icon in the panel and click Edit Connections.
  • Select wireless tab, choose the access ID under Name column, click edit.
  • Click the IPv4 Settings tab.
  • Choose Automatic with manual DNS settings from the Method drop-down box.
  • In the DNS Servers text box, type “,”.
  • In the Search Domains text box, leave it blank
  • Click OK and close the network manager window.

This worked ok. if you change your ISP or access public wifi point you can alter steps as

  • Click the IPv4 Settings tab
  • IPv4 Settings
  • choose Automatic (DHCP)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s