Iirc, the behavior you are seeing in dig is by design. By default, dig will not 
use the search domain defined in /etc/resolv.conf unless you use the +search 
option on dig.

That’s why utilities like host and ping, etc work just fine but dig returns a 
blank record.

Try using dig +search maroon and it should resolve properly by appending the 
search domain to the query.

> On Aug 4, 2019, at 10:13 PM, dnsmasqyq....@neverbox.com wrote:
> 
> On Sun, Aug 4, 2019 at 7:10 PM Geert Stappers wrote:
> 
>>     ....
>> 
>>> So what else I can use beside `resolvectl`?
>>> 
>>> | Basically, look at the top of /etc/resolv.conf to see what is handeling 
>>> it.
>>> 
>>> Ah, thank!
>>> 
>>> $ systemd-resolve --status | tail -11
>>> Link 2 (eth0)
>>>      Current Scopes: DNS
>>>       LLMNR setting: yes
>>> MulticastDNS setting: no
>>>      DNSSEC setting: no
>>>    DNSSEC supported: no
>>>         DNS Servers: 192.168.0.100
>>>                      192.168.0.10
>>>                      2607:f798:18:10:0:640:7125:xxxx
>>>                      2607:f798:18:10:0:640:7125:yyyy
>>>          DNS Domain: my.own.domain.tld
>>> 
>>> | Somehow I do read "`dig host` expecting `dig host.domain.tld`"
>>> | because I have been bitten by assuming that domain name always
>>> | gets added.
>>> 
>>> Bingo! That's exactly the problem!!
>>> 
>>> | Recheck the configuration of your DHCP server ...
>>> 
>>> For DHCP server configuration, I'm following this almost word for word:
>>> https://sfxpt.wordpress.com/2013/11/30/dnsmasq-installation-configuration-5/
>>> 
>>> So how do I make sure that the domain name always gets added, in my
>>> DHCP/DNS server configuration?
>> 
>> Wrong question. Probably due jumping to conclusions.
>> 
>> Show us, this mailinglist, the content of  /etc/resolv.conf
>> Output of `dig foo`, `dig foo.my.own.domain.tld` and `ping -c 3 foo`.
>> Where 'foo' is host known at the local DNS.
> 
> - - - - - -
> $ cat /etc/resolv.conf
> # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
> #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
> # 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 my.domain.tld
> 
> $ dig maroon
> 
> ; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> maroon
> ;; global options: +cmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 40527
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
> 
> ;; OPT PSEUDOSECTION:
> ; EDNS: version: 0, flags:; udp: 65494
> ;; QUESTION SECTION:
> ;maroon.                                IN      A
> 
> ;; Query time: 0 msec
> ;; SERVER: 127.0.0.53#53(127.0.0.53)
> ;; WHEN: Sun Aug 04 23:04:25 EDT 2019
> ;; MSG SIZE  rcvd: 35
> 
> $ dig maroon.my.domain.tld
> 
> ; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> maroon.my.domain.tld
> ;; global options: +cmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7401
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
> 
> ;; OPT PSEUDOSECTION:
> ; EDNS: version: 0, flags:; udp: 65494
> ;; QUESTION SECTION:
> ;maroon.my.domain.tld.              IN      A
> 
> ;; ANSWER SECTION:
> maroon.my.domain.tld.       0       IN      A       192.168.0.101
> 
> ;; Query time: 0 msec
> ;; SERVER: 127.0.0.53#53(127.0.0.53)
> ;; WHEN: Sun Aug 04 23:04:35 EDT 2019
> ;; MSG SIZE  rcvd: 61
> 
> $ ping -c 3 maroon
> PING maroon.my.domain.tld (192.168.0.101) 56(84) bytes of data.
> 64 bytes from wpad (192.168.0.101): icmp_seq=1 ttl=64 time=0.201 ms
> 64 bytes from wpad (192.168.0.101): icmp_seq=2 ttl=64 time=0.381 ms
> 64 bytes from wpad (192.168.0.101): icmp_seq=3 ttl=64 time=0.377 ms
> 
> --- maroon.my.domain.tld ping statistics ---
> 3 packets transmitted, 3 received, 0% packet loss, time 2025ms
> rtt min/avg/max/mdev = 0.201/0.319/0.381/0.086 ms
> - - - - - -
> 
>> Groeten
>> Geert Stappers
>> Who thinks that OP has a working configuration ...
> 
> Thanks
> 
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss@lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>> 
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


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

Reply via email to