On Sat, Oct 19, 2019 at 10:21:26PM +0100, Chris Green wrote:
> On Sat, Oct 19, 2019 at 10:21:21PM +0200, Geert Stappers wrote:
> > On Sat, Oct 19, 2019 at 09:02:19PM +0100, Chris Green wrote:
> > > > > 
> > > > > I've suddenly lost the ability to resolve local machine names without
> > > > > a domain suffix, e.g.:-
> > > > > 
> > > > >     chris$ host t470
> > > > >     Host t470 not found: 2(SERVFAIL)
> > > > >     chris$ host t470.zbmc.eu
> > > > >     t470.zbmc.eu has address 192.168.1.92
> > > > >     chris$ 
> > > > > 
> > > > 
> > > > 
> > > Strangely I seem to be able to resolve local names without a suffix
> > > now.  I have rebooted a few machines, maybe something simply got
> > > full/misconfigured and a reboot has cleared it up.
> > 
> > OK
> > 
> I'm still a bit worried by all this as everything seemed to be working
> well for many months and years and now it's all a bit hit and miss.
> 
> On the Raspberry Pi I can't resolve names without a domain:-
> 
>     chris@newdns$ grep -e search -e domain /etc/resolv.conf
>     chris@newdns$ host esprimo
>     Host esprimo not found: 3(NXDOMAIN)
>     chris@newdns$ host esprimo.zbmc.eu
>     esprimo.zbmc.eu has address 192.168.1.3
>     chris@newdns$ 
> 
> 
> On my laptop, running xubuntu 19.04 I see:-
> 
>     chris$ grep -e search -e domain /etc/resolv.conf
>     search zbmc.eu
>     search zbmc.eu
>     chris$ more /etc/resolv.conf
>     # Dynamic resolv.conf(5) file for glibc resolver(3) generated by 
> resolvconf(8)
>     # 127.0.0.53 is the systemd-resolved stub resolver.
>     # run "systemd-resolve --status" to see details about the actual 
> nameservers.
> 
>     search zbmc.eu
>     nameserver 127.0.0.53
>     search zbmc.eu
>     chris$ host esprimo
>     esprimo.zbmc.eu has address 192.168.1.3
> 
> 
> On my desktop machine (also running xubuntu 19.04) :-
> 
>     chris@esprimo$ grep -e search -e domain /etc/resolv.conf
>     search zbmc.eu
>     chris@esprimo$ more /etc/resolv.conf
>     # Dynamic resolv.conf(5) file for glibc resolver(3) generated by 
> resolvconf(8)
>     # 127.0.0.53 is the systemd-resolved stub resolver.
>     # run "systemd-resolve --status" to see details about the actual 
> nameservers.
> 
>     nameserver 127.0.0.53
>     search zbmc.eu
>     chris@esprimo$ 
> 
> Other machines (running xubuntu 18.04) look similar to the desktop
> machine.
> 
> 
> So why does my laptop have *two* "search zbmc.eu" lines in
> /etc/resolv.conf whereas other machines only have one?

Yes, your laptop and your other machines in your network.


> Also, how does this line get added to /etc/resolv.conf?

Welcome to the wonderful world of the server-client-concept.

The DHCP client does a "DHCP request", DHCP server (Dnsmasq) answers.
In the reply are 
https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#Client_configuration_parameters
 
such as code 15 (domain) and code 119 (domain search).
Client uses the recieved configuration parameters (where it seems fit).

Check in the manual page of Dnsmasq the section "--domain". It starts
with: "Specifies DNS domains for the DHCP server." and contains
| In addition, when a suffix is set then hostnames without a domain part
| have the suffix added as an optional domain part. Eg on my network I
| can set --domain=thekelleys.org.uk and  have  a machine whose DHCP
| hostname is "laptop". The IP address for that machine is available
| from dnsmasq both as "laptop" and "laptop.thekelleys.org.uk".
That gives some information about _server_ side.

What happens at _client_ side, actually happens at _client_ side.

 
> ... and why doesn't a local name only work on the machine running dnsmasq?

Sorry, can't parse that question. If the question was
} ... and why does a local name only work on the machine running dnsmasq?
or 
> ... and why doesn't a local name work on the machine running dnsmasq?
say so.  Yes, do put effort in asking a question.[1]


Groeten
Geert Stappers

Footnote
[1] Read http://www.catb.org/~esr/faqs/smart-questions.html to prevent
    silence as an answer.
-- 
Leven en laten leven

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to