systemd-resolution sembra non interrogare il server DNS specificato

Oct 10 2020

Modifica: durante il tempo che mi ci è voluto per scrivere questa domanda apparentemente si è risolta da sola, ora funziona come previsto. Sono ancora interessato al motivo per cui questo potrebbe essere successo :)

La mia configurazione è la seguente:

Ho un server DNS locale (pihole per essere precisi) all'indirizzo 192.168.1.200. Ho anche un server nella mia rete domestica all'indirizzo 192.168.1.300. Il mio dominio example.compunta al mio IP pubblico 5.5.5.5. Il pihole ha alcune voci DNS personalizzate, in modo che quando sono all'interno della mia rete locale, example.comviene risolto a 192.168.1.300invece di 5.5.5.5(per evitare problemi con NAT) ho impostato il server DNS per il mio wifi su 192.168.1.200. (È anche impostato nel router ...)

Ora, in qualche modo, ottengo ancora l'IP 5.5.5.5 da systemd-resolution.

Ho svuotato la cache DNS con sudo systemd-resolve --flush-caches

sudo systemd-resolve --statistics restituisce una dimensione della cache pari a 0

systemd-resolve --status | grep "DNS Servers" Spettacoli 192.168.1.200

Ora arriva la parte interessante:

dig example.com ritorna 5.5.5.5

mentre dig example.com @192.168.1.200ritorna192.168.1.300

Come è possibile? Come ottengo systemd-resolution per interrogare effettivamente il server DNS che ho impostato?

qualche informazione in più:

  • ls -al /etc/resolv.conf ritorna lrwxrwxrwx 1 root root 39 Sep 26 2019 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
  • cat /etc/resolv.conf ritorna
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0
search home
  • dpkg -l *dnsmasq* ritorna
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version          Architecture     Description
+++-======================-================-================-==================================================
un  dnsmasq                <none>           <none>           (no description available)
ii  dnsmasq-base           2.79-1           amd64            Small caching DNS proxy and DHCP/TFTP server
un  dnsmasq-base-lua       <none>           <none>           (no description available)

  • grep -i dns /etc/systemd/resolved.conf ritorna
#DNS=
#FallbackDNS=
#MulticastDNS=no
#DNSSEC=no
#DNSStubListener=yes

Risposte

1 Tschösi Oct 27 2020 at 20:15

Quello che ha risolto il mio problema era correre sudo /etc/init.d/dns-clean restart