Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I deactivated NetworkManager with sudo apt-get remove network-manager because I want to have all network configuration in /etc/network/interfaces.

After system restart, I see that cat /etc/resolv.conf is empty.

cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

It seems the DNS Server address need to be configured manually. Is this the right conclusion?

How would I add the address of the DNS server to /etc/resolv.conf?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Your conclusion is correct. May I assume you are setting up static IP addresses? If so, declare your DNS nameservers like this:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 192.168.1.1

If you are using DHCP, the DHCP server should serve, in addition to the addresses, DNS nameservers.

share|improve this answer
    
Absolute correct. Everything is static. All my VM's should be servers and here I do not understand how DHCP can be used. A server should have all the time same the IP address. Anyhow you comment confirms my conclusion. –  fgeld Jan 19 at 16:57
    
I agree with you entirely but you'd be shocked how many questions I've answered where people struggle setting up a server with DHCP!!! –  chili555 Jan 19 at 20:11
add comment

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.