RECOMMENDED Amnezia Premium: Works Where Other VPNs Fail

Unblockable AmneziaWG 2.0 & XRay protocols. Perfect for lag-free access to ChatGPT, Claude AI, global freelance marketplaces, and restricted streaming networks with clean RAM-only privacy.

How to see DNS in Linux

How to see DNS in Linux

DNS or Domain Name System lets you turn easy-to-read website address in the ip address of the server that is hosting this website. For this purpose, the DNS servers that contain mappings of ip addresses to their domain names. By default, the system gets the address of the DNS server automatically by DHCP when you connect to the network.

In this article we will understand how to see what DNS servers are used on Linux.

How to see DNS in Linux

If you have already had the experience of network configuration in Linux, then you know that DNS servers used for resolving domain names specified in the file /etc/resolv.conf:

sudo vi /etc/resolv.conf

But in modern Linux distributions with systemd init system usually are running a local DNS server, the address of which is registered in this file and which servers are actually unclear. In this case, you can use the systemd-resolve:

systemd-resolve --status

At the bottom of the output tool you can view DNS in Linux that are now used. Information is displayed for each network interface separately.

To solve this problem you can use the nmcli tool:

nmcli dev show | grep DNS

As you can see, it’s very simple. And to change the DNS server also touch /etc/resolv.conf is not desirable, as it will be automatically updated after a reboot. If you are using NetworkManager, you can configure DNS for your network connection in the interface. Or you can edit the file /etc/systemd/resolved.conf and add the desired address to the section Resolve:

sudo vi /etc/systemd/resolved.conf

[Resolve]
DNS=8.8.8.8, 8.8.4.4

As you can see, it’s very simple. I hope this information was useful for you.

Source: losst.ru

🛠️ Top Temporary VPS for Testing & Experiments (2026)

Need a fast cloud server for a few hours or days? Deploy an isolated testing environment, run your scripts, and destroy it without any monthly commitments. Secure payments via Crypto (USDT) & PayPal supported.

AÉZA — Ultimate Testing Environment Flexible rates: from €0.01/hr depending on the billing period (the longer you rent, the cheaper it gets).
Exclusive Welcome Bonus: Get an extra 15% on your first balance top-up within 24 hours after registration.
Deploy on Aeza
Friendhosting — High-Storage VDS Hourly VDS infrastructure (from €0.03/hr) deployed across massive global locations.
• Best-in-class Storage VDS configurations with huge disk space for heavy data testing.
Deploy on Friend
Zomro — Premium Daily Node Daily billing model starting at just €0.16/day (~€0.007/hr) for optimal cost control.
• High-speed hardware platform with a stable presence in the Netherlands (Europe).
Deploy on Zomro
Rork

Linux hobbyist into networking and digital privacy. I use this hub to translate and store technical notes on sysadmin tasks and anonymity tools. Tech should work for people, not the other way around.

Rate author
Add a comment