[Dnsmasq-discuss] I've lost my ability to resolve local machine names without a domain suffix

john doe johndoe65534 at mail.com
Sun Oct 20 11:17:50 BST 2019


On 10/20/2019 10:15 AM, Chris Green wrote:
> On Sun, Oct 20, 2019 at 08:59:03AM +0200, Geert Stappers wrote:
>> On Sat, Oct 19, 2019 at 10:21:26PM +0100, Chris Green wrote:
>>>
>>> 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.
>>
> Only my laptop gets *two* "search zbmc.eu" lines, all the other
> machines (well, all two of them that are actual accessible computers
> running Linux) have only one "search zbmc.eu" which seems more
> reasonable.
>
>
>>
>>> 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).
>>
> OK, yes, I supposed that must be the way it happens.  I guess for some
> reason my laptop is doing something odd/wrong.  In fact I've just had
> a thought, it maybe connects using WiFi sometimes and using a wired
> connection at other times.  It could well be that it sends out a DHCP
> broadcast request for both wired and WiFi connections.
>
>
>> 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.
>>
> I don't add any command line options to dnsmasq, my changes to the
> defaults in /etc/dnsmasq.conf are as follows:-
>
>     domain-needed
>     bogus-priv
>     expand-hosts
>     domain=zbmc.eu
>     dhcp-range=192.168.1.80,192.168.1.127,12h
>     dhcp-option=3,192.168.1.1
>     dhcp-authoritative
>     local=/zbmc.eu/
>     cname=bbb,beaglebone
>     cname=mx201,maxine-X201
>     cname=ben,DESKTOP-978VD5M
>     cname=oki,MC342-AE529C
>     dhcp-host=00:BB:3A:E9:A3:15,maxineKindle
>     dhcp-host=00:09:B0:C9:CE:81,onkyoTx-nr616
>     dhcp-host=28:EF:01:2D:EB:07,chrisKindle
>     dhcp-host=08:EB:74:9D:47:53,humaxFreeview
>     dhcp-host=2C:08:8C:CC:9A:9E,humaxYouview
>     dhcp-host=00:1F:E2:4E:8F:CA,maxineStudy
>     dhcp-host=AC:AE:19:2C:3F:5A,roku
>     dhcp-host=10:FE:ED:63:29:74,TL-WA7210
>     dhcp-host=00:25:36:AE:52:9C,192.168.1.50
>
> So I have a domain= like you.
>
>> What happens at _client_ side, actually happens at _client_ side.
>>
> Yes, of course, and it seems to be all OK now after restarting
> everything (but no other changes) so *something* had got out of kilter
> so that unqualified names weren't working but was fixed by the reboots.
> It may well be that upgrades (that don't usually require restarts on
> Linux) had got some systemd bits in a tangle which a restart sorted out.
>
>>
>>> ... 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]
>>
> Asking for the address of an unqualified name on the machine running
> dnsmasq fails:-
>
>     chris at newdns$ host esprimo
>     Host esprimo not found: 3(NXDOMAIN)
>     chris at newdns$ host esprimo.zbmc.eu
>     esprimo.zbmc.eu has address 192.168.1.3
>     chris at newdns$
>
> Is there any way to fix this?  It's not incredibly impoprtant because
> I only rarely do anything (as in log in and run programs) on that
> machine but it would be nice if it worked the same as the other
> machines on the LAN.
>
> It's presumably down to the order in which it runs its client DHCP
> requests versus when dnsmasq starts so that it can answer itself.
>

You are not using 'dhcp-fqdn' (1)?

1)  http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

--
John Doe



More information about the Dnsmasq-discuss mailing list