As a Linux user, particularly when running Ubuntu, knowing how to configure DNS name servers is a practical skill that could undeniably elevate your overall experience. If properly set up, DNS name servers can improve your system’s internet resolution process. You may be wondering, 'What are DNS name servers, and how can they benefit my Ubuntu Linux experience?'. Well, don't worry! This article is intended to be your helpful guide, simplifying the process by breaking it down into manageable steps.
Understanding DNS: The Basics
The Domain Name System (DNS) plays a crucial role in your online activity. It is the unsung hero that translates human-friendly website URLs into Internet Protocol (IP) addresses that computers understand. The DNS name servers are computers stored with public IP information about various web servers. Designating DNS name servers on your Ubuntu Linux system is crucial, as it enables faster and more efficient communication with the internet.
Prerequisites
Before you start, make sure your Ubuntu system is updated with the command sudo apt-get update
. It's also preferable you have sudo privileges or root access to ensure a smooth setup process.
Step 1: Determining Current DNS Settings
To check your current DNS settings on Ubuntu Linux, use the command systemd-resolve --status
. The output will include a section with your current DNS Servers.
Step 2: Setting up DNS Name Servers on Ubuntu Linux
Our main agenda is to modify DNS settings, which are often located in the resolv.conf file (/etc/resolv.conf
).
To set DNS name servers on Ubuntu Linux, open the 'Netplan' configuration file using the directory /etc/netplan/
. Use your preferred editor for this – vim, nano, or others.
If you're a fan of the nano editor, your command would look something like this: sudo nano /etc/netplan/01-netcfg.yaml
.
In the opened file, you would usually find something like this:
# This file is generated from information provided by# the datasource. Changes to it will not persist across an instance.# To disable cloud-init's network configuration capabilities, write a file# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:# network: {config: disabled}network: version: 2 ethernets: ens3: dhcp4: true
To set the DNS, you need to modify this file to include the nameservers
you want. For example:
network: version: 2 ethernets: ens3: dhcp4: true nameservers: addresses: [8.8.8.8,8.8.4.4]
Here, 8.8.8.8 and 8.8.4.4 are Google public DNS servers.
After you make changes, save and exit the file.
Step 3: Applying Changes
To apply the changes you've made, use the command sudo netplan apply
.
Step 4: Confirming the New DNS Settings
Now, confirm if the desired DNS settings have been applied successfully by repeating the command systemd-resolve --status
. The output should now reflect the new DNS servers.
Troubleshooting Common Issues & FAQ
Sometimes, Linux users may encounter issues when configuring DNS settings. If you run into a problem, remember that consistency is key in resolving it. Check that the syntax in the configuration file is correct and the DNS servers' addresses are valid.
Managing DNS name servers in Ubuntu Linux promotes a seamless internet usage experience. It offers control over your internet traffic directing and even shields against attacks by not relying exclusively on ISP servers. As you journey forward in your Ubuntu Linux exploration, skills like these, coupled with your perseverance, undeniably enrich you and empower your Linux journey. So, go forth and navigate the DNS world with confidence!
Tidak ada komentar:
Posting Komentar