Are you looking to add a DNS server to systemd-resolved? Look no further!
In this tutorial, we will guide you through the process step by step. By the end of this article, you’ll have a clear understanding of how to configure systemd-resolved with a DNS server of your choice.
What is systemd-resolved?
Before we dive into the steps, let’s quickly understand what systemd-resolved is. It is a system service in Linux that provides network name resolution to local applications. It acts as a local DNS resolver and handles network name resolution requests.
Step 1: Open the Configuration File
The first step is to open the /etc/systemd/resolved.conf file in your favorite text editor. This file contains the configuration options for systemd-resolved.
To open the file, run the following command:
$ sudo nano /etc/systemd/resolved.conf
Step 2: Add DNS Server Address
In the configuration file, you’ll find a section called [Resolve]. This section contains various options related to name resolution.
Look for the line that says #DNS=
. Uncomment it by removing the ‘#’ at the beginning of the line.
Beneath that line, add your desired DNS server address. For example:
You can add multiple DNS servers by specifying each address on a new line.
Step 3: Save and Exit
Once you have added the DNS server addresses, save the file by pressing Ctrl + O and exit the editor by pressing Ctrl + X.
Step 4: Restart systemd-resolved
To apply the changes, you need to restart the systemd-resolved service. Run the following command:
$ sudo systemctl restart systemd-resolved
Step 5: Verify Configuration
To verify that your DNS server has been successfully added to systemd-resolved, you can use the resolvectl command. Run:
This will display detailed information about your current DNS configuration, including the DNS server addresses.
Congratulations!
You have successfully added a DNS server to systemd-resolved. Now your system will use the specified DNS server for name resolution.
In this tutorial, we learned how to open the configuration file, add a DNS server address, save and exit, restart systemd-resolved, and verify our configuration using resolvectl.
We hope this article was helpful in guiding you through the process of adding a DNS server to systemd-resolved. Now you can enjoy faster and reliable name resolution on your Linux system!
9 Related Question Answers Found
How Do I Add a DNS Server to an Existing Domain? When it comes to managing a domain, one of the essential tasks is configuring the DNS servers. Adding a DNS server to an existing domain can be done easily by following a few simple steps.
Adding a DNS Server to Your Router
So, you want to add a DNS server to your router? Well, you’ve come to the right place. In this article, we will guide you through the process step by step.
Are you having trouble accessing websites or experiencing slow internet connection? One possible cause for these issues could be a DNS server problem. The Domain Name System (DNS) is responsible for translating domain names into IP addresses, allowing your computer to connect to websites.
Welcome to this tutorial on how to add a DNS server to your Cisco router. In this article, we will guide you through the process step by step, ensuring that you have a clear understanding of each stage. Let’s get started!
Adding a DNS server to a domain is an essential step in managing your website’s domain name system. The DNS server helps translate human-readable domain names into IP addresses, allowing users to access your website. In this tutorial, we will guide you through the process of adding a DNS server to your domain.
How Do I Resolve the DNS Server Address? When it comes to accessing websites or online services, one of the most crucial components is the DNS (Domain Name System) server. It acts as a translator that converts human-readable domain names into IP addresses that computers can understand.
Adding a DNS server to your computer can be a useful way to enhance your internet browsing experience. By changing the default DNS server provided by your internet service provider (ISP), you can potentially improve the speed and reliability of your internet connection. In this tutorial, we will explore how to add a DNS server to your computer using different operating systems.
How Do I Resolve Primary DNS Server? When it comes to troubleshooting network connectivity issues, one common problem you may encounter is a “Primary DNS Server” error. This error occurs when your device is unable to connect to the DNS server responsible for translating domain names into IP addresses.
In this tutorial, we will learn how to add a DNS server to FreeBSD. DNS (Domain Name System) is responsible for resolving domain names into IP addresses, allowing computers to communicate with each other over the internet. Configuring a DNS server on your FreeBSD system can greatly improve network performance and reliability.