I have a DNS server I use to route traffic to local services. For example, it points router.home.lan to my router.

However, when I try to visit this address in my browser on my Ubuntu machine, it takes an extremely long time to load. If I visit the page on my Macbook or use the IP address on my Ubuntu machine then the page to load instantly.

I believe it has something to do with the DNS resolution on my Ubuntu machine. Here is the output from host:

time host -v router.home.lan                                            
Trying "router.home.lan"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59318
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;router.home.lan.       IN  A

router.home.lan.    2   IN  A

Received 49 bytes from in 12 ms
Trying "router.home.lan"
;; connection timed out; no servers could be reached

Trying "router.home.lan"
;; connection timed out; no servers could be reached

host -v router.home.lan  0.01s user 0.01s system 0% cpu 20.021 total

The first result comes back instantly, then the next two time out after 10 seconds each. I get the same behavior with ping.

This only happens with my local services on the home.lan domain.

Changing nameserver in /etc/resolv.conf to the IP of my local DNS server fixes the problem, however that's not sustainable as it frequently gets overwritten and causes issues outside of my network.

  • Would setting the IP address of the DNS server in /etc/hosts not give you the consistency you’re looking for? 🤔
    – matigo
    Commented Sep 12, 2021 at 15:34
  • @matigo - the file says "This file is managed by man:systemd-resolved(8). Do not edit." and thus the changes I make are often overwritten. I've read that I can set the name server in the /etc/resolvconf/resolv.conf.d/base file but that has no effect. Also, this DNS server only applies within my home which is why I'd rather not hard code it for the whole system.
    – kfoley
    Commented Sep 12, 2021 at 16:36

1 Answer 1


In terminal, type:


And edit your "Wired Connection".

enter image description here

  • I've tried setting both the "DNS Servers" as well as "additional search domains" to the relevant values but it doesn't seem to have an effect. However I did this for my wireless network instead of "Wired Connection" as my laptop doesn't have a wired connection.
    – kfoley
    Commented Sep 12, 2021 at 16:34
  • @kfoley Show me cat /etc/resolv.conf, then reboot, then show me cat /etc/resolv.conf again. Also show me ls -al /etc/resolv.conf.
    – heynnema
    Commented Sep 12, 2021 at 16:44
  • @kfoley Status please...
    – heynnema
    Commented Sep 19, 2021 at 13:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .