[Dnsmasq-discuss] DNS on localhost

Simon Kelley simon at thekelleys.org.uk
Tue May 28 14:05:44 BST 2013


On 27/05/13 15:03, Ramon Hofer wrote:
> HI all
>
> Sorry if this question has already been asked but I can't find why it's
> not working for me.
>
> I want to use the dns on the localhost where dnsmasq runs. So I have
> set up dnsmasq that all hosts get an IP and are related to a hostname
> in dnsmasq.conf. It looks like this:
>
>   bogus-priv
>   interface=eth1
>   dhcp-range=192.168.72.250,192.168.72.254,12h
>   dhcp-host=xx:xx:xx:xx:xx:xx,host-2,192.168.1.2,48h
>   ...
>   dhcp-option=option:ntp-server,192.168.1.1
>
>
> On the hosts I can use the hostnames instead of the ip addresses but
> not on the server.
> I'd prefer to have all settings stored centrally so I'd like not to
> copy them into /etc/hosts.
>
> I found that I can use the dns-nameserver setting
> in /etc/network/interfaces:
>
>   auto eth1
>   iface eth1 inet static
>          address 192.168.1.1
>          netmask 255.255.255.0
>          dns-search domain
>          dns-nameservers 192.168.1.1
>
> But it's still the same. I can't use the hostnames on the server.
>
> Do I have to set anything else?
> Any help would be very much appreciated.
>
>

I can't see anything obviously amiss there. except that it's 
conventional to use 127.0.0.1 for the nameserver address in this case.

Look in /etc/resolv.conf, which is the real location of the nameserver 
configuration, and make sure that it's been copied there from 
/etc/network/interfaces.


Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list