Linux doesn’t resolv DNS correctly

I hate Ubuntu, but right now i’m working with this because i don’t have time to install and configure my favorite slackware distribution. 

Actually, when i connect to my network or another, the system take a lot of time to resolve the sites (as google, yahoo, etc).

I saw that Ubuntu have an issue with the resolv.conf file due Systemd.

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1624320

If you check the /etc/resolv.conf you can see that only have the 127.0.0.53 and the message run “…systemd-resolve –status…”

If you run this tool you can see:

[code language=”bash”]
root@ap0th3os1s:/home/morfeokmg# systemd-resolve –status
Global
DNS Servers: 192.168.1.254
8.8.8.8
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 5 (vmnet8)
Current Scopes: LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no

Link 4 (vmnet1)
Current Scopes: LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no

Link 3 (wlo1)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no

Link 2 (enp8s0)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 8.8.8.8
fe80::1
[/code]

I needed put the DNS servers to solve manually, due than the resolv.conf only had the .53 IP.

[code language=”bash”]
root@ap0th3os1s:/home/XXXXXX# 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
[/code]

To solve this issue (as workarround) I proceeded as below:

Check the file link.

[code language=”bash”]
root@ap0th3os1s:/home/morfeokmg# ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 29 sep 30 22:42 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
[/code]

remove the actual file link and associate with the correct file

[code language=”bash”]
root@ap0th3os1s:/home/morfeokmg# rm -f /etc/resolv.conf
root@ap0th3os1s:/home/morfeokmg# ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
root@ap0th3os1s:/home/morfeokmg# ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 32 oct 27 13:52 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
[/code]

right now, the file have the correct nameservers that i defined.

[code language=”bash”]
root@ap0th3os1s:/home/morfeokmg# cat /etc/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known DNS servers.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 192.168.1.254
nameserver 8.8.8.8
nameserver fe80::1%2
[/code]

After the change, the connection to the websites are OK (the time resolution)

 

Impacts: 

  • NetworkManager resolution
  • Firefox sites resolution
  • Fail the resolution of the captive portals (Starbucks coffee, or simmilars).
  • etc and more etc (with Ubuntu is not predictible)

Best regards folks.

Dejar un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *