Score:0

Custom DNS server is not working

sa flag

I've got Ubuntu 21.10 installed on a new Framework laptop. I would like it to use my local, custom DNS Server that I set up on a Synology NAS. So, I put that IP address in the correct (I hope) spot in the Ubuntu settings:

Custom DNS Added

However, it appears that this custom DNS server is not being used at all. I run an nslookup command on a local service and it appears to be using some other DNS server, thus it cannot find my local service:

Custom DNS Not Being Used

I have heard from some sources that I should edit the /etc/resolv.conf file directly, but other sources say that it's bad practice to do so and that I should use Ubuntu's settings.

So what am I doing wrong and what should I do to make Ubuntu respect my choice of DNS server(s)?

Edit 12/17/2021: Per the comments, here is the result of systemd-resolve --status initially (with the "Automatic" toggle turned on):

Global
       Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: foreign

Link 2 (wlp170s0)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.50.1
       DNS Servers: 192.168.50.1 192.168.50.10

And then here is the result after turning the "Automatic" toggle off:

Global
       Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: foreign

Link 2 (wlp170s0)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.50.10
       DNS Servers: 192.168.50.10

So, my router is on 192.168.50.1, but I don't see any way that it can use 192.168.50.10 for its primary DNS server.

Nmath avatar
ng flag
"Automatic" appears to be enabled on DNS. If you want to specify a DNS server, you need to disable "Automatic". Does this solve the problem? Don't follow outdated instructions in this case. Read the first line of `/etc/resolv.conf` for a description of why you should not edit this file
sa flag
@Nmath I tried turning off the "Automatic" toggle directly above that DNS field in the past and it didn't work, but I gave it a shot again. And now it works! I'll continue to keep an eye on it and post if/when it fails again, but it looks like that does it. Feel free to turn your comment into an answer so I can give you the proper credit. Thanks!
ru flag
Your system is using `systemd-resolved` which runs a stub resolver on your system that then sends to upstream DNS servers. Show us the output of `systemd-resolve --status` so we can see what DNS servers are set in the system.
Score:2
ng flag

In your system settings screenshot, you currently have "Automatic" enabled next to the field where you enter your custom DNS IP address.

You should disable "Automatic" for DNS. Once you do that, DNS requests should be queried from the IP address you specify in the field.

Keep in mind that individual applications might not use the DNS server that you specify in your system settings. Examples include Tor, VPN clients, and potentially even your web browser. Notably, there has been a trend for apps to move to using DoH since it is more secure and more private than typical DNS lookups which are sent in plaintext.

Getting your DNS server to work for these applications will generally need to be configured for each application in their settings. For example, Firefox has been pushing DoH lately, but you can opt-out.

ru flag
Keep in mind this won't fix the resolv.conf issue- `systemd-resolved` is the default and has the stub resolver listening on that local IP so you ahve to do some work to find the actual DNS servers in use
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.