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.

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)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1

And here, dhcpd.conf:

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

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.253;
option routers 192.168.1.254;
option broadcast-address 192.168.1.255;
option domain-name-servers 192.168.1.10;
option ntp-servers 192.168.1.10;
option netbios-name-servers 192.168.1.10;
option netbios-node-type 8;
}

Lastly, the hostfile for the server:

127.0.0.1       localhost
127.0.1.1       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

1 Answer 1

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: https://help.ubuntu.com/10.04/serverguide/network-configuration.html#name-service-switch-config

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

 
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.