5

I have recently upgraded my laptop to 19.04 (previously 18.04) and since then I have a problem with DNS resolution.

It takes exactly 15 seconds to resolve any address. For example here is a wireshark trace for the command "ping www.google.ch" which show the erratic behaviour in DNS resolution (sorry for pasting a log blob):

  1 0.000000000    127.0.0.1             127.0.0.53            DNS      82     Standard query 0x9885 A google.ch OPT
  2 0.000040848    127.0.0.1             127.0.0.53            DNS      82     Standard query 0xf398 AAAA google.ch OPT
  3 0.000472315    192.168.1.61          192.168.1.1           DNS      71     Standard query 0xbc08 A google.ch
  4 0.000751989    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
  5 0.003821221    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
  6 0.004064023    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
  7 0.005267971    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
  8 0.005497112    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
  9 0.006644819    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 10 0.006863866    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 11 0.007920878    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 12 0.008130719    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 13 0.009242334    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 14 0.009637573    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 15 0.010792517    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 16 0.011031800    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 17 0.012258637    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 18 0.012489432    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 19 0.013713170    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 20 0.013915614    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 21 0.014032986    192.168.1.1           192.168.1.61          DNS      87     Standard query response 0xbc08 A google.ch A 172.217.168.35
 22 0.014322592    127.0.0.53            127.0.0.1             DNS      98     Standard query response 0x9885 A google.ch A 172.217.168.35 OPT
 23 0.015102484    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 24 0.015277122    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 25 0.016431079    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 26 0.016609622    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 27 0.017757978    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 28 0.017919223    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 29 0.018984296    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 30 0.019164206    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 31 0.020291847    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 32 0.020465090    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 33 0.021606042    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 34 0.021834229    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 35 0.022902638    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 36 0.023076859    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 37 0.024185348    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 38 0.024369468    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 39 0.025402235    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 40 0.025557918    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 41 0.026557335    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 42 0.026681040    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 43 0.027705800    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 44 0.027808876    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 45 0.028793187    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 46 0.028893739    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 47 0.029878670    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 48 0.029986119    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 49 0.031010405    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 50 0.031127410    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 51 0.032151807    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 52 0.032261394    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x335e AAAA google.ch
 53 0.033290733    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x335e Refused AAAA google.ch
 54 5.001947117    127.0.0.1             127.0.0.53            DNS      82     Standard query 0x9885 A google.ch OPT
 55 5.002322889    127.0.0.53            127.0.0.1             DNS      98     Standard query response 0x9885 A google.ch A 172.217.168.35 OPT
 56 5.002450775    127.0.0.1             127.0.0.53            DNS      82     Standard query 0xf398 AAAA google.ch OPT
 57 5.002829396    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 58 5.005749595    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 59 5.006000720    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 60 5.007085084    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 61 5.007278137    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 62 5.008493792    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 63 5.008726953    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 64 5.009760440    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 65 5.009962097    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 66 5.011064276    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 67 5.011294755    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 68 5.012464702    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 69 5.012696487    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 70 5.013803847    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 71 5.013991838    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 72 5.015081146    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 73 5.015311695    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 74 5.016397601    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 75 5.016572805    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 76 5.018326688    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 77 5.018522763    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 78 5.019673004    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 79 5.019905288    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 80 5.020942721    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 81 5.021117750    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 82 5.022175880    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 83 5.022368879    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 84 5.023497195    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 85 5.023727693    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 86 5.024716756    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 87 5.024917772    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 88 5.025940891    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 89 5.026242405    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 90 5.027396468    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 91 5.027627309    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 92 5.028669617    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 93 5.028844156    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 94 5.029909396    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 95 5.030099489    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 96 5.031241631    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 97 5.031470878    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
 98 5.032507283    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
 99 5.032684260    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
100 5.033712152    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
101 5.033923324    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
102 5.035076891    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
103 5.035307433    192.168.1.61          192.168.1.1           DNS      71     Standard query 0x897a AAAA google.ch
104 5.036458185    192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x897a Refused AAAA google.ch
105 10.005946641   127.0.0.1             127.0.0.53            DNS      82     Standard query 0x9885 A google.ch OPT
106 10.006376461   127.0.0.53            127.0.0.1             DNS      98     Standard query response 0x9885 A google.ch A 172.217.168.35 OPT
107 10.006552675   127.0.0.1             127.0.0.53            DNS      82     Standard query 0xf398 AAAA google.ch OPT
108 10.006923636   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
109 10.009568741   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
110 10.009795245   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
111 10.010954209   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
112 10.011184364   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
113 10.012458263   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
114 10.012691547   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
115 10.013805929   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
116 10.014036944   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
117 10.015165110   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
118 10.015403914   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
119 10.016501372   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
120 10.016710396   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
121 10.017809472   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
122 10.017988063   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
123 10.019114116   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
124 10.019353925   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
125 10.020505187   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
126 10.020741642   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
127 10.021814158   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
128 10.022045574   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
129 10.023153608   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
130 10.023336649   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
131 10.024412807   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
132 10.024632391   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
133 10.025813396   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
134 10.026244008   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
135 10.027357668   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
136 10.027535923   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
137 10.028599634   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
138 10.028776517   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
139 10.029782946   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
140 10.029961443   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
141 10.031008052   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
142 10.031186821   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
143 10.032214660   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
144 10.032393053   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
145 10.033518425   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
146 10.033744680   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
147 10.034887325   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
148 10.035116833   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
149 10.036226120   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
150 10.036458904   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
151 10.037515996   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
152 10.037775347   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
153 10.038839704   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
154 10.039017849   192.168.1.61          192.168.1.1           DNS      71     Standard query 0x2b09 AAAA google.ch
155 10.040061077   192.168.1.1           192.168.1.61          DNS      71     Standard query response 0x2b09 Refused AAAA google.ch
156 15.024825964   127.0.0.1             127.0.0.53            DNS      100    Standard query 0xb4e4 PTR 35.168.217.172.in-addr.arpa OPT
157 15.025320672   192.168.1.61          192.168.1.1           DNS      89     Standard query 0x0774 PTR 35.168.217.172.in-addr.arpa
158 15.038823507   192.168.1.1           192.168.1.61          DNS      127    Standard query response 0x0774 PTR 35.168.217.172.in-addr.arpa PTR zrh04s14-in-f3.1e100.net
159 15.039215285   127.0.0.53            127.0.0.1             DNS      138    Standard query response 0xb4e4 PTR 35.168.217.172.in-addr.arpa PTR zrh04s14-in-f3.1e100.net OPT

The ping is blocked for exactly 15 seconds when the PTR query is done (around packet nr 156), even tho the A record is received 3 times at packets 21, 55 and 106.

This happens only when I am at work on a wifi that do not supports ipv6 at all. At home I have ipv6 and have no problems at all. On the wifi settings for the problematic network i have disabled ipv6 (gnome settings) but it has no influence on this behaviour.

Systemd resolved configuration is the default:

$ cat /etc/systemd/resolved.conf
...
[Resolve]
#DNS=
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#DNSOverTLS=no
#Cache=yes
#DNSStubListener=yes
#ReadEtcHosts=yes


Edit as requested by @heynnema

$ ls -al /etc/resolv.conf 
lrwxrwxrwx 1 root root 39 Aug 17  2018 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
$ cat /etc/resolv.conf
# 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 "resolvectl 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 media.int Home
$ dpkg -l *dnsmasq*
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.80-1ubuntu1 amd64        Small caching DNS proxy and DHCP/TFTP server
un  dnsmasq-base-lua <none>        <none>       (no description available)

$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no

$ systemd-resolve --status
Global
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 10 (docker0)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 9 (vethKHVDZJ)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 7 (lxdbr0)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 6 (virbr0-nic)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 5 (virbr0)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 4 (enx4865ee119deb)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (wlp2s0)
      Current Scopes: DNS
DefaultRoute setting: yes
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
  Current DNS Server: 192.168.1.1
         DNS Servers: 192.168.1.1
          DNS Domain: ~.
                      Home

Link 2 (enp0s31f6)
      Current Scopes: DNS
DefaultRoute setting: yes
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
  Current DNS Server: 10.136.8.10
         DNS Servers: 10.136.8.10
                      10.137.24.10
          DNS Domain: media.int

As a bonus here are my routes:

$ ip r
default via 192.168.1.1 dev wlp2s0 proto dhcp metric 600 
10.0.0.0/8 via 10.168.38.1 dev enp0s31f6 proto static metric 10 
10.168.38.0/24 dev enp0s31f6 proto kernel scope link src 10.168.38.154 metric 100 
169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
192.168.1.0/24 dev wlp2s0 proto kernel scope link src 192.168.1.61 metric 600 
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown 
192.168.224.0/24 dev lxdbr0 proto kernel scope link src 192.168.224.1 

NEW Edit:

Manually editing /etc/resolv.conf and using any of the dns servers returned by resolvectl status solves my problem.

The problem only exist when systemd-resolved is used as a resolver, i've tried changing the option DNSSEC with every possible value. Still same problem.

So i finally made a script as a workaround:

$ cat bin/fix-dns.sh
#!/bin/bash
sudo sed -i '/^nameserver/ s/127.0.0.53/10.136.8.10/' /etc/resolv.conf


What can i do to change this? Why the resolver insist that much on ipv6 and why it waits for a PTR records before giving the answer to the client?

Thanks in advance for your help.

8
  • Welcome to Ask Ubuntu. :-) What is the output on your home network with IPV6 disabled? – Fabby Aug 5 '19 at 16:17
  • Edit your question and show me ls -al /etc/resolv.conf and cat /etc/resolv.conf and dpkg -l *dnsmasq* and cat /etc/NetworkManager/NetworkManager.conf and lastly systemd-resolve --status. Start comments to me with @heynnema or I may miss them. – heynnema Aug 5 '19 at 23:06
  • @heynnema edited the question as requested. – dafan Aug 6 '19 at 9:27
  • 1
    @Fabby, thanks! I will only be able to test that during the weekend – dafan Aug 6 '19 at 9:29
  • Thanks for the info! Nothing jumps out at me though. You wouldn't happen to be running with DSL at work? – heynnema Aug 6 '19 at 14:46
1

From the comments...

The symlink for /etc/resolv.conf was set to /run/systemd/resolve/stub-resolv.conf which contains options edns0. Some networks don't respond to this DNS extension, and DNS resolution breaks.

We reset the symlink with:

sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

This would have probably also worked:

sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf

Postnote:

One problem you may also have is with the MTU setting for your DSL connection.

There's a MTU setting in Ubuntu's network configuration, and a WAN MTU setting in your router.

For DSL, a common MTU setting is 1492. Just go ahead and try this value first and see if your web sites are now accessible.

To determine the correct setting, start with all MTU settings = 1500 and VPN = off. (VPN requires different testing).

In terminal:

ping [-c count] [-M do] [-s packet_size] [host]

The options used are:

  • c count: number of times to ping
  • M hint: Select Path MTU Discovery strategy. may be either do (prohibit fragmentation, even local one), want (do PMTU discovery, fragment locally when packet size is large), or dont (do not set DF flag).
  • s packet_size: Specifies the number of data bytes to be sent.

You should always start at 1472 and work your way down by 10 each time. Once you get a reply, go up by 1 until you get a fragmented packet. Take that value (last good value) and add 28 to the value to account for the various TCP/IP headers. Eg. let's say that 1452 was the proper packet size (where you first got an ICMP reply to your ping). The actual MTU size would be 1480, which is the optimum for the network we're working with.

ping -c 4 -M do -s 1472 8.8.8.8 # this will probably show fragmentation

ping -c 4 -M do -s 1462 8.8.8.8 # may show fragmentation

ping -c 4 -M do -s 1452 8.8.8.8 # no fragmentation?

ping -c 4 -M do -s 1453 8.8.8.8 # still no fragmentation?

reference: How to determine the proper MTU size with ICMP pings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.