DNS rotating while on VPN without using dnsmasq

I’m somewhat of a linux newbie so please be kind. I’m having intermittent DNS resolution issues while connected to my company VPN. After running nslookup in debug mode it looks like the system is using DNS out of rotation. (sometimes it uses the company’s DNS, other times it randomly defaults to my ISPs). The search paths are also being used out of rotation (rather than from first to last).

  • I am not using dnsmasq
  • I do not have options rotate set in resolv.conf.
  • Not using anything weird like “Round robin”.
  • nsswitch.conf hosts is set to “files dns”.
  • /etc/NetworkManager/NetworkManager.conf doesn’t have anything set for dns or rc-manager

I ran “watch cat /etc/resolv.conf” to see if any other process or software was overriding my resolv.conf, but that doesn’t appear to be the case. Not sure what else to check or what else could be causing issues.


Kernel: 5.4.64-1-MANJARO

You do not mention the kind of VPN connection to your corporate LAN.

But some setup’s using OpenVPN require you allow for scripting in the vpn config and to use special up and down scripts to reset the DNS.

Some use of VPN are causing minor frustration until you become aware of the issues - the cause and cure - and seldom two issues are the same - especially with corporate vpn - so those corp usually have a support department and you should talk to your corp it support.

Thanks for reaching out! I use OpenVPN, I reached out the one of our Networking guys who was baffled at my issues and was unable to provide a resolution. We have several employees on different Linux flavors but I’ve reached out to other Manjaro and Arch users verified my network manager, vpn, resolv.conf and other configurations with theirs and could not find any issues with mine. I seem to be the only person experiencing this issue and was hoping to find someone else who’s experienced this who may have a solution.

Enable script in your vpn config - then depending on your network manager - use the up/down scripts referenced on Arch Wiki in the OpenVPN article.

The Linux DNS issue when using OpenVPN is well known.

awesome thank you! I’ll give it a shot!

Can you post a log at verb 4 showing the connection from start to “Initialization Sequence Completed”?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.