AvoidErrors
  • HOME
  • WINDOWS
  • APPLE
  • MS OFFICE
  • RASPBERRY PI
  • WORDPRESS
  • TECH TIPS
  • LINUX
  • VIRTUALIZATION
  • FORUM
No Result
View All Result
AvoidErrors
No Result
View All Result

How to Setup DNS in Ubuntu

Abdelrahman Reda by Abdelrahman Reda
November 2, 2018
in Linux
0
Share on FacebookShare on Reddit
Download this tool to Recover Deleted Photos

Previously, to configure the DNS servers to be used by the system, it was enough to enter the addresses of the required servers in the /etc/resolv.conf file. But now Network Manager manages the entire network configuration in Ubuntu, and this file is now only a link to the Network Manager.

This method still works, but in it, you can configure DNS on the LiveCD, or till rebooting. After the reboot, all the settings will reset and you will have to do everything again. Therefore, in order to preserve everything, you need to perform all actions through the Network Manager interface.

Click on the Network icon and choose “Edit Connections”.

Select your connection and click “Edit”.

In the next window click on “IPv4 settings” tab.

Then on the “Method” field choose “Automatic (DHCP)”

Now in the “Additional DNS servers,” you can add necessary DNS servers.

Several DNS addresses can be separated by commas. For example, you can use Google DNS.

Then you should click “Save” and can close that window.

Now you should reconnect to that connection and can check the current DNS server:

Open the Terminal and execute the following command

Nslookup avoiderrors.com

DNS Setup trough Ubuntu Terminal

Ubuntu has a unified network configuration interface that is configured via the configuration file

/ etc / network / interfaces.

Open the file for editing in the Terminal and find in it the name of your network interface, for example, “auto enp0s3”, if there is no such section, you need to add it:

sudo vi /etc/network/interfaces

auto enp0s3
iface enp0s3 inet dhcp

dns-nameserver 8.8.8.8

Here, the address 8.8.8.8 is the address of your DNS server. But this setting will work only if your DHCP client is not trying to assign an address automatically. To specify the DNS address at the DHCP server level, add the following line to the /etc/dhcp/dhclient.conf configuration file:

sudo vi /etc/dhcp/dhclient.conf

supersede domain-name-servers 8.8.8.8

To be sure, you can add your DNS server addresses to the /etc/resolvconf/resolv.conf.d/base file:

sudo vi /etc/resolvconf/resolv.conf.d/base

nameserver 8.8.8.8

After you should restart the network.

 sudo systemctl restart networking

Now you can open /etc/resolv.conf and check that the new DNS address has been applied.

Previous Post

How to Find Email Headers in Outlook 2016

Next Post

How to Restart Services from Linux Terminal

Abdelrahman Reda

Abdelrahman Reda

Abdelrahman Reda is a Motivated Support Engineer with 6+ years of corporate and consumer support experience. His experience related to administration of Network, NOC support, computers and anti-virus server, data entry, networking sites, remote support.

Related Posts

Install ownCloud on Ubuntu 20.04 LTS DigitalOcean
Linux

Install ownCloud on Ubuntu 20.04 LTS DigitalOcean

by Miguel
June 21, 2022 - Updated on June 22, 2022
Completely Remove Windows 11 and Install Ubuntu
Linux

Completely Remove Windows 11 and Install Ubuntu

by Miguel
April 8, 2022

Subscribe to get weekly tutorials direct to your inbox!

Disable Windows Defender SmartScreen – Windows 11
Windows

Fix Windows 11 Defender Not Working

by Rhousse
January 24, 2023
How to Fix 503 Service Unavailable Error in Windows 10 
Windows

Fix HTTP Error 503: The Service is Unavailable in Windows 11

by Rhousse
January 24, 2023
How to Modify Mouse Pointer in Windows 10
Windows

How to Fix Black Screen With Cursor in Windows 11

by Rhousse
January 24, 2023
Restore the Old Windows Desktop Icons – Windows 11
Windows

Fix and Enable Drag and Drop on Windows 11

by Rhousse
January 24, 2023




  • Disclaimer & Privacy Policy
  • FAQ
© 2022 Powered by Cloudways
No Result
View All Result
  • HOME
  • WINDOWS
  • APPLE
  • MS OFFICE
  • RASPBERRY PI
  • WORDPRESS
  • TECH TIPS
  • LINUX
  • VIRTUALIZATION
  • FORUM

© 2022 AvoidErrors Powered by Cloudways | Privacy

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.