Score:0

Can we set up a DNS server to override the Router DNS server?

mx flag

I am aware that when we type a domain name, unless it is cached in the pc or router, it requests the DNS to an external server, to get the IP address.

Apparently, the DHCP server from the router is setting itself for DNS (192.168.1.254). Issuing systemd-resolv --status or resolverctl status gives

Link 3 (wlp1s0)
      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.254
         DNS Servers: 192.168.1.254
          DNS Domain: ~.
                      lan

I didn't set up the router and have no access to it, so I'd like to be sure my locally defined DNS is used.

  1. Can I know which DNS the router is using from my laptop, without accessing the router config?
  2. How can I set up a local DNS to be google dns 8.8.8.8 or some you recommend?

I took a look at Ubuntu docs but seems complicated.

in flag
If you’re using Ubuntu Desktop, you can specify any DNS server you wish in the network settings
Minsky avatar
mx flag
I don't know what you mean exactly, I answered below @matigo with the way I found.
Score:0
mx flag

For-all-interfaces DNS server can be set in /etc/resolv.conf to test, as it is wiped out at reboot.

I just added

nameserver 8.8.8.8

And then confirm using resolvectl status, which has now a global setting pointing to that DNS server.

According to the resolvectl, resolvconf, systemd-resolve etc (they are mostly the same), we can set up per interface DNS, for example:

resolvectl dns wlp1s0 8.8.8.8

Again the config is updated, you can see both in this log:

Global
  Current DNS Server: 8.8.8.8
         DNS Servers: 8.8.8.8
          DNS Domain: lan

Link 3 (wlp1s0)
      Current Scopes: DNS
         DNS Servers: 8.8.8.8
          DNS Domain: ~.
                      lan
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.