I am trying to configre my openSuSE 12.1 machine as DHCP client, but especially do not want it to set the name server entries to /etc/resolv.conf it has got from DHCP server.

Can I do it on the client site without manually deleting the entries afterwards?

On windows machines this is possible due to the setting

(   ) Obtain DNS server address automatically

(O) Use the following DNS server addresses:

and then just leave the fields for Preferred and Alternate DNS server blank.

2 Answers 2


Add to your /etc/dhclient.conf:

supersede domain-name-servers HERE_THE_DNS_SERVER_IP;
  • sorry, but the file /etc/dhclient.confdoesn't exists, instead I found another dhcp-client config file /etc/sysconfig/network/dhcp. I tried to add your line to it, but even after invoking /sbin/SuSEconfig again, the entries still remain in my resolf.conf... I also tried to set void nameservers in YaST (e.g., &, but the client still sets it's search domain to the one gotten from DHCP server... Apr 17, 2012 at 6:55
  • Does setting NETCONFIG_DNS_STATIC_SERVERS in /etc/sysconfig/network/config help?
    – jofel
    Apr 17, 2012 at 8:08

Modify or add the line PEERDNS=no to the configuration file that corresponds with your network interface in the directory /etc/sysconfig/network-scripts/.

If your network device is eth0, the file to modify will be named ifcfg-eth0.

To find the name of your network interface use the command ip address show to list your network interfaces and their addresses.

Additionally, you can specify the DNS entries that you want to have appear in /etc/resolv.conf by adding the lines DNS1=<ip-address> and DNS2=<ip-address> to the network configuration file.



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .