[Dnsmasq-discuss] resolving server's hostname

Albert ARIBAUD albert.aribaud at free.fr
Sun Feb 19 08:59:45 GMT 2017

Hi Carl,

Le Sat, 18 Feb 2017 21:53:52 -0600
Carl Karsten <carl at nextdayvideo.com> a écrit:

> [...]
> so if I set no-hosts, how does dnsmaq figure out how to resolve
>> dc10b?

Just the same way it does any other machine; the fact that a machine is
a name server does not make its name(s) or IP address(es) any special
in the *content* of the zone it serves.

For instance:

- some zone admins will want the local DHCP and DNS server(s) to not
  have any entry in the local zone, because no machine in the LAN is
  supposed to need refering them by name.

- some zone admins will want to give the DHCP server the name "dhcp"
  and the DNS server the name "dns" because they want to be able to
  not remember the actual IP address for them.

- some zone admins will want every machine on the LAN to have a name
  which describes the make and model of the machine, e.g. "rpi-1234",
  and they want this to apply to servers too.

- etc.

So, really, as far as the zone contents is concerned, dnsmasq does not
care whether an entry in it is the DNS server, DHCP server, or neither.
If you want the local machines to know that dc10b is, then
you should have an entry in the zone for it. Whether you do that with
an /etc/hosts line, or you use no-hosts and put a host-record option in
your dnsmasq configuration file is up to you. Either method works.

> ore really, what should I be doing so that 'things work as I expect' ?

What you should do is define what you expect :) -- i.e. decide how you
want to manage the content of your LAN zone.

For instance, in my case I want the the host running my dnsmasq known
by both a 'given name' and several functional names, and I want *all*
LAN host names in a single file different from he dnsmasq configuration
file, so I use addn-hosts to point dnsmasq to this file, which contains
among others the 'given' and functional names of the dnsmasq server

But how /you/ do it is really for /you/ to decide; the way /I/ do may
not fit your needs.


More information about the Dnsmasq-discuss mailing list