Documentation Index

Fetch the complete documentation index at: https://help.nordlayer.com/llms.txt

Use this file to discover all available pages before exploring further.

How to change DNS on Linux?

Prev Next

Generally, the NordLayer application for Linux handles DNS settings automatically, and manual DNS configuration should not be needed. While you are connected, NordLayer configures DNS for you so that your queries are resolved securely through the VPN tunnel, and it restores your previous DNS settings when you disconnect.

However, for troubleshooting or specific scenarios, this guide shows how to edit, add, or remove DNS settings on your Linux device.

DNS (the Domain Name System) is what translates human-readable addresses such as nordlayer.com into the IP addresses your device actually connects to. When DNS is misconfigured or slow, websites can fail to load even though your internet connection is otherwise working — which is why DNS is one of the first things worth checking when troubleshooting connectivity.

To make DNS handling as smooth as possible:

  • Ensure systemd-resolved is installed and running, or that NetworkManager is managing DNS.
  • Make sure the DNS server is reachable.

NordLayer detects and supports several DNS mechanisms automatically: sys-temd-resolved, NetworkManager, the **resolvconf **tool (e.g. openresolv), and directly editing /etc/resolv.confas a fallback.

Ensuring systemd-resolved is installed and running

  1. Open the terminal with CTRL + ALT + T and run:
systemctl status systemd-resolved 
  1. This shows detailed information about the service (press q to exit).
  2. DNS servers should be visible per interface:
resolvectl

(Use the up/down keys to navigate and q to exit.)

Installing systemd-resolved

systemd-resolved is installed as part of systemd and is active by default on most common Linux distributions. If needed, you can enable it with:

sudo systemctl enable --now systemd-resolved

Making sure DNS is reachable

Check whether a DNS server is reachable. You can ping any well-known public resolver — for example 1.1.1.1 or 8.8.8.8:

ping 1.1.1.1

(Press CTRL + C to exit.)
You should also be able to perform DNS requests. The command below asks a resolver to look up nordlayer.comand should return one or more IP addresses:

dig nordlayer.com

If dig is not installed, you can use resolvectl query nordlayer.com with systemd-resolved) or nslookup nordlayer.com instead.

Advanced topics

When systemd-resolved is not available

If neither systemd-resolved nor NetworkManager is viable, you can install openresolv (for advanced users):

On Ubuntu and Debian-based distributions:

sudo apt install openresolv

On Fedora:

sudo dnf install openresolv

Choosing a different DNS server

You can use the default NordLayer DNS server, apply Web Protection DNS settings, or set up custom DNS on a server with a dedicated IP.

Setting DNS servers for a manual VPN connection (when not using the application)

When using a manual VPN connection, a DNS server can be set on the VPN interface (nlx0 for NordLynx or ovpn0 for OpenVPN), preferably through System Settings or Network Manager. Alternatively, it can be set using openresolv. For example, OpenDNS
uses:
208.67.220.222 for the primary server
208.67.220.220 for the secondary server


Note: In case you have any questions or are experiencing any issues, please feel free to contact our 24/7 customer support team.

Can't find what you need?

Live chat

Contact our support to solve an issue live.

Chat functionality relies on cookies. By starting the chat, you agree to their use. Learn more in our Cookie Policy.