1

I recently updated my Ubuntu which ended in a shot DNS config.

I am able to add a nameserver to /etc/resolvconf/resolv.conf.d/tail (and restart the service) to get DNS resolution for everything internet related.

Doing this also means i will never be able to resolve local IPs and names (and vice versa). This can be very helpful especially in big intranets like the internal network of a university. Although i have no idea how and why, this worked prior to the update.

I was under the impression, that usually a DNS request is sent to the default gateway for the respective interface, if no other DNS server is specified.

Is this correct?

Whithout any other DNS server specified, the only nameserver in /etc/resolv.conf is 127.0.0.53, the "systemd-resolv stub resolver".

Is there any way to configure systemd-resolv or resolvconf to send a DNS request to the default gateway of the interface specified by the routing table?

(When i use dig @(default gateway) (name of local machine/domain name) i get a correct response. This means my home access point/router is able to answer DNS requests)

  • 1
    Why is your DHCP server not providing a DNS server entry? If you are using a static config via /etc/network/interfaces then use the dns-nameservers option – ivanivan Mar 2 '18 at 16:51
  • Thanks! I did not know that DHCP also provides a DNS server. This already answers all my questions. I had my interface configured as manual, and just wrongly assumed that DNS server configuration was unaffected. – user278636 Mar 2 '18 at 17:17
  • The question is mixing several concepts and is confusing, I think. – Rui F Ribeiro Mar 2 '18 at 17:42
2

In order to close this thread i will answer all my questions on the off chance that somebody in my situation comes across this post.

"I was under the impression, that usually a DNS request is sent to the default gateway for the respective interface, if no other DNS server is specified.

Is this correct?"

Yes this is correct, but since the default gateway is not always also the DNS server, the DNS server IP is provided by the DHCP server. If you configure your your Network connection as anything besides "DHCP", your OS will not get this DNS configiration.

"Whithout any other DNS server specified, the only nameserver in /etc/resolv.conf is 127.0.0.53, the 'systemd-resolv stub resolver' ."

Although this has nothing to do with my problem i thought i give a little bit of context: The systemd-resolved resolves things like the name of your own computer, 'localhost', and the name/ip pairs provided in the /etc/hosts file.

" Is there any way to configure systemd-resolv or resolvconf to send a DNS request to the default gateway of the interface specified by the routing table?"

As stated, this is usually not really necessary since using DHCP provides the local DNS-servers ip for you.

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.