Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

To start with, my Linux or networking knowledge is fairly basic, so it's probably best to assume that I know nothing.

I've been trying (for my own furtherance) to put together some sort of home server, using Ubuntu Server 12.04. I have so far got a DHCP and DNS server, and it can lease IP addresses and resolve Internet domain names, but I cannot (almost certainly due to my own incompetence) resolve the hostnames of local machines. Here is resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

And here, dhcpd.conf:

# option definitions common to all supported networks...
option domain-name "";
option domain-name-servers,;
option domain-name "owen.lan";
default-lease-time 600;
max-lease-time 7200;

subnet netmask {
option routers;
option broadcast-address;
option domain-name-servers;
option ntp-servers;
option netbios-name-servers;
option netbios-node-type 8;

Lastly, the hostfile for the server:       localhost       main-server.home        main-server

# The following lines are desirable for IPv6 capable hosts</code>
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

What (probably obvious) point am I missing?

share|improve this question

This sounds like a problem I have been dealing with on my newly Ubuntu-ized laptop. I'm not trying to run a DNS or DHCP server on it, but I have been unable to resolve local network addresses, while everything out on the internet resolves fine. What worked for me was changing the Network Service Switch configuration (/etc/nsswitch.conf).

The question that led me to this solution can be found here. Look for the answer which beings "edit the /etc/nsswitch.conf file." why do none of my local servers resolve

...which points to this page for more information:

Simply moving "dns" before "[NOTFOUND=return]" in the "hosts:" string, as recommended, worked for me! Hopefully it's that simple for you too.

share|improve this answer

Your Answer


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.