Ubuntu

Setting up DNS Nameserver on Ubuntu 20.04

Introduction

Setting up a DNS (Domain Name System) server on Ubuntu 20.04 is a crucial step in managing your network’s domain names and IP addresses. DNS is responsible for translating human-readable names of domains into machine-readable IP addresses, facilitating seamless communication between devices on a network. In this guide, we will explore two methods to configure DNS Nameserver on Ubuntu 20.04 – through the graphical user interface (GUI) and by manually editing configuration files.

Change DNS Nameserver via GUI

Change DNS Nameserver via GUI

Setting up DNS server configurations via the graphical user interface (GUI) provides a convenient and accessible method for users who prefer a more visual approach. This user-friendly process ensures that even those without in-depth technical knowledge can easily manage their DNS settings on Ubuntu 20.04.

1. Access Network Settings:

To initiate the process, start by going to the “Settings” menu on your Ubuntu desktop. This can specifically be seen in the system menu or accessed through the application launcher.

Access Network Settings

2. Select Network Options:

Under the “Settings” menu, search and choose the “Network” option. This will take you to an exhaustive display of your network-related configurations.

3. Choose Active Connection:

Identify and click on the active link you desire to adjust. A window dedicated to the selected network connection will come up, rendering diverse customization choices.

4. Navigate to DNS Settings:

Within the network connection window, look for the IPv4 or IPv6 tab, depending on your specific network configuration. These tabs represent the Internet Protocol versions used in your network.

5. Input DNS Server Addresses:

Look for an option to input DNS server addresses. This could be labeled as “DNS” or “Additional DNS” in the IPv4/IPv6 configuration. Enter the preferred DNS server addresses in the provided space, separating them with commas.

Input DNS Server Addresses

6. Save Changes:

After entering the DNS server details, ensure to save your modifications. This is particularly done through a “Save” or “Apply” button within the network settings window.

7. Automatic DNS Configuration:

Ubuntu will automatically update its DNS configuration based on the changes you’ve made. This ensures that the newly specified DNS servers will be utilized for resolving domain names on your system.

By going with these steps, you have effectively set up DNS server configurations on Ubuntu 20.04 using the graphical interface. This method caters to users who prefer simplicity and a point-and-click approach to manage their DNS settings effectively.

Change DNS Nameserver via Config File

Change DNS Nameserver via Config File

For users who prefer a more hands-on and manual approach, configuring DNS settings via the resolv.conf file is a powerful method. This method provides a deeper level of control and is particularly suitable for those comfortable with the command line and text editors.

1. Open Terminal:

To begin, open a terminal on your Ubuntu 20.04 system. This can be done by searching for “Terminal” in the application launcher or using the keyboard shortcut Ctrl + Alt + T.

2. Navigate to /etc Directory:

Use the cd command to navigate to the /etc directory where critical system configuration files are stored. Type cd /etc and press Enter.

# ls /etc/netplan/
# ls /etc/netplan/

3. Locate the resolv.conf File:

Once inside the /etc directory, locate the resolv.conf file. This file contains the DNS configuration settings for your system. You can use commands like ls to list files and ls | grep resolv.conf to specifically search for the file.

Locate the resolv.conf File

4. Open resolv.conf with a Text Editor:

Use a text editor like vim, nano, etc. to open the resolv.conf file. For example, type sudo nano resolv.conf and press Enter. You will require the rights of administrative to modify this file

Open resolv.conf with a Text Editor

5. View Existing DNS Configurations:

Inside the resolv.conf file, you’ll find existing DNS configurations. These might include entries such as “nameserver” followed by IP addresses. Take note of these existing settings.

6. Add New DNS Server Addresses:

Below the existing DNS configurations, add the new DNS server addresses. Use the “nameserver” keyword followed by the IP address of each DNS server, placing each on a new line. This is the site where you execute the modifications you want to make.

7. Save and Exit:

Save the changes made to the resolv.conf file. In nano, you can execute this with the help of Ctrl + X, then confirm the modifications with Y and press Enter.

8. Restart Networking Service or Reboot:

Restart Networking Service or Reboot

For the changes to take effect, either restart the networking service or simply reboot your Ubuntu system. You can restart the networking service by employing the command sudo systemctl restart networking.service.

By following these steps, you’ve successfully configured DNS settings on Ubuntu 20.04 by editing the resolv.conf file. This method provides a manual and precise way to set up DNS servers, giving users more control over their network configurations.

Why Change DNS Nameserver on Ubuntu?

Why Change DNS Nameserver on Ubuntu?

1. Performance Optimization:

Changing DNS nameservers on Ubuntu can significantly improve your network’s performance. The default DNS servers rendered by your ISP might not be optimized for speed. By setting up a custom DNS server, you get the right to lessen the time it consumes for resolving domain names, leading to faster website loading times and overall improved internet browsing experiences.

Consideration: When selecting a DNS server, look for options that are known for low latency and quick response times.

2. Custom DNS Services for Improved Speed:

Setting up a DNS server allows you to choose custom DNS services that are specifically designed for speed and efficiency. Some third-party DNS providers, such as Google DNS or OpenDNS, are renowned for their fast and reliable resolution times. By configuring your Ubuntu system to use these services, you can harness the benefits of their optimized infrastructure.

Tip: Compare the performance of different DNS services using online benchmarks to find the one that suits your requirements.

3. Enhanced Security Measures:

Utilizing trusted DNS servers as part of setting up DNS servers on Ubuntu enhances the security of your network. Reputable DNS providers often implement security measures, such as blocking access to known malicious websites or filtering out phishing attempts. This extra level of security guards your system and personal information from probable cyber threats.

Best Practice: Choose DNS servers that prioritize security and regularly update their threat databases.

4. Protection Against Cyber Threats:

The DNS settings on your Ubuntu system perform a vital element in securing against Internet threats. Malicious websites often rely on domain names to carry out attacks. By using a DNS server with advanced threat detection capabilities, you can block access to these malicious domains, providing an extra layer of defense against phishing, malware, and other online threats.

Implementation: Regularly update your DNS server settings and consider using DNS-based filtering tools for additional security.

5. Reliability and Redundancy:

Setting up a DNS server on Linux, specifically Ubuntu, allows you to introduce redundancy and reliability into your network. Some DNS providers offer multiple servers distributed globally. Configuring your system to use such servers can ensure that even if one server is unavailable, your system can seamlessly switch to an alternate server, preventing disruptions in internet connectivity.

Recommendation: Choose DNS servers that provide redundancy and have a robust global infrastructure.

Also Read: Ubuntu LTS Desktop Installation Steps

Final Words

Setting up a DNS server on Ubuntu 20.04 is a basic component of network management. Whether you opt for the GUI method for its simplicity or the manual file editing for greater control, the goal is to optimize your DNS settings for a smoother and more secure online experience. Experiment with diverse DNS services to find the one that best fits your necessities as well as preferences. Take control of your network by mastering the art of setting up DNS nameservers on Ubuntu.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *