[Dnsmasq-discuss] Resolution Question

/dev/rob0 rob0 at gmx.co.uk
Fri Apr 10 17:56:39 BST 2015


On Fri, Apr 10, 2015 at 12:17:30PM +0200, Gavin Hill wrote:
> This may be a more generic DNS question than a dnsmasq specific
> one, but seeing as I’m running dnsmasq I hoped someone on the list 
> may be able to help me.

Actually it is in-part specific to dnsmasq, probably.

> I can resolve a host name with and without the domain name suffix,

This is not a feature of the DNS; it is one which has been grafted 
onto it by various resolver clients.  A DNS query for a name with no 
dots would go to the root zone, and if not found, would return 
NXDOMAIN.

> but when I try to use an application to resolve the FQDN it fails.  
> See below for an example.  I am stumped as to why the “host” 
> command can resolve the FQDN but other applications cannot.  Any 
> guidance would be very much appreciated.
> 
> gaz at zeus:~$ host sg200-1
> sg200-1.beerygaz.local has address 192.168.1.5

See "-N" in the host(1) manual.  Since the name has no dots, it's 
considered relative to the domains listed in the search or domain 
directive in /etc/resolv.conf.

> gaz at zeus:~$ host sg200-1.beerygaz.local
> sg200-1.beerygaz.local has address 192.168.1.5

BTW you should not use the .local pseudo-TLD in DNS, because its use 
has been specified for the MDNS (a/k/a zeroconf) protocol.  You might 
get inconsistent results ...

> gaz at zeus:~$ ping sg200-1
> PING sg200-1.beerygaz.local (192.168.1.5) 56(84) bytes of data.
> gaz at zeus:~$ ping sg200-1.beerygaz.local
> ping: unknown host sg200-1.beerygaz.local

... like this.  Actually I don't know why ping failed to resolve this 
name.  You might want to look into your nsswitch.conf(5) file and 
manual to see what's going on.  But MDNS is a possible culprit.

> gaz at zeus:~$ cat /etc/resolv.conf 
> domain beerygaz.local
> search beerygaz.local.

With dnsmasq you do not need to set a domain or search, because 
dnsmasq will do what you hope/expect with unqualified names:

$ dig sg200-1 @192.168.1.4

This works for dnsmasq DHCP names and for unqualified names in your 
hosts(5) file.

> nameserver 192.168.1.4
-- 
  http://rob0.nodns4.us/
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:



More information about the Dnsmasq-discuss mailing list