Score:1

Ubuntu clients can't resolve LAN hosts stored in local unbound server

bi flag

I have setup an unbound server to use short names to refer to various servers by the hostname only. Example: I can call http://myserver:8080/ And it works as expected from Android, and Windows clients, but on 2 Ubuntu 23.04 clients it doesn't work at all.

Unbound is on host 192.168.1.2, and here's the output of dig from ubuntu querying the unbound server itself:

$ dig -x @192.168.1.2 myserver
; <<>> DiG 9.18.12-1ubuntu1-Ubuntu <<>> @192.168.1.2 -p 53 myserver
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28727
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;myserver.                         IN      A

;; ANSWER SECTION:
myserver.                  1069    IN      A       myserverIP

;; Query time: 8 msec
;; SERVER: 192.168.1.2#53(192.168.1.2) (UDP)
;; WHEN: Tue May 30 04:03:55 MST 2023
;; MSG SIZE  rcvd: 50

Now when I run the same query on my ubuntu client it fails with this:

$ dig myserver

; <<>> DiG 9.18.12-1ubuntu1-Ubuntu <<>> myserver
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 58494
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;myserver.                         IN      A

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Tue May 30 04:09:55 MST 2023
;; MSG SIZE  rcvd: 34

At first I thought it was the domain being set by the router and maybe these clients would inherit the domain to search which wouldn't resolve, since that isn't setup in unbound.

$ nmcli device show wlo1
GENERAL.DEVICE:                         wlo1
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         HWADDR
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     MYSSID
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/6
IP4.ADDRESS[1]:                         192.168.1.XXX/24
IP4.GATEWAY:                            GATEWAYIP
IP4.ROUTE[1]:                           dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 600
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = GATEWAYIP, mt = 600
IP4.DNS[1]:                             192.168.1.2
IP4.DNS[2]:                             192.168.1.3
IP4.DOMAIN[1]:                          Home
IP6.ADDRESS[1]:                         IPV6ADDR
IP6.GATEWAY:                            --

Then I tried to setup a static IP which cleared the IP4.DOMAIN[1] value. And still no dice. Then I changed the /etc/resolv.conf from this:

nameserver 127.0.0.53
options edns0 trust-ad
search Home

to this:

nameserver 192.168.1.2
nameserver 192.168.1.3

And it works great! But since this is managed by resolvectl, it keeps resetting this file whenever it goes to standby or reboots. What is the canonical way to fix this weird DNS issue?

I'd like to avoid using hosts files, because I plan on adding more hosts to the network and that adds a lot of overhead, vs updating 2 DNS servers.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.