Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

https://www.suse.com/documentation/sled11/book_sle_admin/data/sec_basicnet_manconf.html

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-networkscripts-interfaces.html

share|improve this answer

Add to your /etc/dhclient.conf:

supersede domain-name-servers HERE_THE_DNS_SERVER_IP;
share|improve this answer
    
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. 127.0.0.1, 127.0.0.2 & 127.0.0.3), but the client still sets it's search domain to the one gotten from DHCP server... – Master of Celebration Apr 17 '12 at 6:55
    
Does setting NETCONFIG_DNS_STATIC_SERVERS in /etc/sysconfig/network/config help? – jofel Apr 17 '12 at 8:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.