I have several questions about the internal workings of network-manager, systemd-resolve, and the /etc/resolv.conf and any other files such as nsswitch.conf.

Is there a file or several files, where DNS server information could be entered and have the resolved read it and automatically add it to the /etc/resolv.conf at each boot up instead of deleting my information or only using the DHCP DNS information?

Are there any documents, with deep technical details, about how all of these subsystems work now, The network-manager, resolved, naming services, and DHCP?

Are there any instances where someone has something setup like this and have overcome the problem we are having?


I have an ubuntu 18.04 desktop computer that we are testing to be the new, bigger,better desktop for the company. This desktop has to connect to the internet through AT&T or SPECTRUM or some cable company. Then an openvpn tunnel is going to connect to our openvpn servers. In our current testing, when we do this allowing network-manager to control things our computers do not resolve our company servers through the openvpn tunnel unless a very specific set of circumstances are met. Essentially in the end we have to put the DNS server information into the /etc/resolv.conf file manually.

So I have a theory, but without technical documents that explain how things work, it is just a theory.

The Desktop computer is turned on, it boots and reads DHCP for its network data. This data includes all of the normal pieces of information. The IP address, the DNS, the gateway, etc. The DNS data gets stored in a cache someplace in the OS kernel space. This data is stored away from the normal data that would come from static files. This data is then connected to the system via the internal network of The DNS mechanism is handled through a variety of IPC calls in the kernel. This is what allows applications to access DNS data via the API.

Now I have a lot of years of experience, 35, as a UNIX engineer so some or all of this explanation may be wrong. IF there is a document that explains how all of this works with a lot of technical details, then I could probably read that and figure it out myself. Maybe I am just not looking in the correct place for the documents.

It would be great if I could find a way to get this working. So the final outcome needs to be this:

Users login from home across an Internet Modem of some ISP. They then launch openvpn. Once openvpn is launched and connects, work can begin.

Right now this is broken.

If you need more data feel free to ask me. I can give you all kinds of data about the computers configurations, but I can not give you any sensitive company data or references.

Thank you in advance for your assistance.


Bill Branson

  • Sounds like a standard vpn setup. I found adding the libnss-resolve package to a fresh 18.04 fixed some DNS problems. Add DNS servers to /etc/systemd/resolved.conf . Don't touch /etc/resolve.conf – ubfan1 Jun 7 at 22:45
  • It's magic. Really. No, only the Ubuntu design engineers can tell you how it all works. Getting it all to work can take some time. However... edit your question and show me ls -al /etc/resolv.conf and cat /etc/resolv.conf. We'll start there. – heynnema Jun 8 at 14:00
  • Hello @heynnema, So here are the two outputs you wanted to see. Let me know if you need anything else. Thank you. Sincerely Bill Branson ########### root@U18DesktopTest:/etc# ls -al /etc/resolv.conf lrwxrwxrwx 1 root root 39 May 28 11:27 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf ############## root@U18DesktopTest:/etc# cat /etc/resolv.conf # This file is managed by man:systemd-resolved(8). Do not edit. nameserver options edns0 search mydomain.com root@U18DesktopTest:/etc# ############ – Bill Branson Jun 18 at 14:22
  • @BillBranson thanks for the info. However, it's normally better to edit this kind of info directly into your question with a copy/paste operation, and then using the {} icon to format that text. Anyway, the /etc/resolv.conf symlink may be incorrect... as there are actually three different places that the symlink should link to. But we'll come back to this later. At this point, we have to separate VPN from the picture, and make sure that basic resolution works first. Do you have specific DNS servers that you want/need to use? Manually editing /etc/resolv.conf is never the correct way. – heynnema Jun 18 at 15:29
  • @BillBranson With VPN out of the picture, are you able to properly ping and ping www.ebay.com? – heynnema Jun 18 at 15:31

I wanted to thank you all for the input and help. We experimented and came up with this as one solution. There may be other solutions, but here is what we did. 1) installed resolvconf with apt. 2) ran sudo dpkg-reconfigure resolvconf 3) Answered no to the dynamic updates. 4) updated our /etc/network/interfaces with the correct DNS nameservers. 5) restarted networking services. So no more dynamic updates from the ISP and the VPN tunnel stays up and running. This was something we had to test out as it was information from second or third hand. Thank you for your time and thought and wisdom. I hope this helps others. Sincerely

Bill Branson

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.