Setting a static DNS nameserver (Debian Squeeze)

7,316

One option would be to adjust your /etc/dhcp/dhclient.conf file to simply not request the domain-name-servers and domain-name DHCP options.

You mention that you provided the dns-nameserver option in your interfaces file. Do you actually have the resolvconf package installed? If not, then that setting isn't going to do anything useful, and DHCP will pretty much always over-write the resolv.conf if DNS options are recieved.

If the resolvconf package is installed you can modify the interface-order config to control the order the settings are used.

Share:
7,316

Related videos on Youtube

Ian Unruh
Author by

Ian Unruh

Updated on September 18, 2022

Comments

  • Ian Unruh
    Ian Unruh over 1 year

    I have a gateway running on Debian Squeeze with 2 network interfaces, one static (internal, eth0) and one DHCP (external, eth1). I have an internal DNS server that I want the gateway to use.

    In my /etc/network/interfaces, I have eth0 set to static, with a dns-nameserver directive, pointing to 192.168.3.4. However, upon rebooting or restarting the networking service, my /etc/resolv.conf changes to the DNS server provided by the external DHCP.

    How can I get Debian to use my internal DNS server but still obtain a DHCP lease from eth1?