I have installed a fresh Debian Jessie distribution today. It properly configured IP address through DHCP and also added nameserver entry in /etc/resolv.conf.

Could you please explain how are those entries automatically added? What happens exactly internally, what steps are needed for such entry to be added automatically?

  • 1
    Is the resolvconf package installed? – Gilles May 26 '15 at 23:18

During installation, DHCP is used to discover the network setup. This includes the IP address as you noticed, but also the subnet, default gateway, and optionally the domain name and nameservers. All the available information is used to set the network up and is stored in the appropriate files for future reference (/etc/network/interfaces, /etc/resolv.conf...).

Optionally, the resolvconf package can be used to maintain /etc/resolv.conf when changing networks. Network Manager can also manage /etc/resolv.conf. Both programs read the information made available by the DHCP server when configuring a network interface, in a similar fashion to the installation program.

You'll find all this and more described in detail in the Debian wiki.


Editing /etc/dhcp/dhclient.conf or /etc/dhcp3/dhclient.conf on debian you can select the dhcp client options(for example the possibility to edit resolv.conf). On server side,the admin can select what to pull(routers,dns,wins server,etc) this is an extract from a tipical linux dhcp server

# My Network - this is the set of addresses that you're handing out
subnet netmask {
        option broadcast-address;
        option subnet-mask;
        option routers;
        option domain-search "yourdomain.com";
        option netbios-name-servers;
        range ;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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