• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to set permanent DNS nameservers on Ubuntu 21.04

  • 00:34 lsb_release -a
  • 00:47 apt install resolvconf
  • 01:12 systemctl start resolvconf.service
  • 01:36 systemctl enable resolvconf.service
  • 02:04 systemctl status resolvconf.service
  • 02:42 nano /etc/resolvconf/resolv.conf.d/head
  • 03:46 resolvconf -u
  • 04:06 nano /etc/resolv.conf
6723

To Set Permanent DNS Nameservers on Ubuntu 21.04

Introduction

DNS stands for Domain Name System server, which is responsible for translating a domain name into an IP address. Using custom DNS servers on Linux can improve performance and security.

Installation Procedure:

Step 1: Check the OS version by using the following command

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute

Step 2: Install the resolvconf package by using the following command

root@linuxhelp:~# apt install resolvconf
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  resolvconf
0 upgraded, 1 newly installed, 0 to remove and 263 not upgraded.
Need to get 54.7 kB of archives.
After this operation, 203 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu hirsute/universe amd64 resolvconf all 1.84ubuntu1 [54.7 kB]
Fetched 54.7 kB in 6s (9,526 B/s)     
Preconfiguring packages ...
Selecting previously unselected package resolvconf.
(Reading database ... 151399 files and directories currently installed.)
Preparing to unpack .../resolvconf_1.84ubuntu1_all.deb ...
Unpacking resolvconf (1.84ubuntu1) ...
Setting up resolvconf (1.84ubuntu1) ...
Created symlink /etc/systemd/system/sysinit.target.wants/resolvconf.service → /lib/systemd/system/resolvconf.service.
Created symlink /etc/systemd/system/systemd-resolved.service.wants/resolvconf-pull-resolved.path → /lib/systemd/system/resolvconf-pull-resolved.path.
Created symlink /etc/systemd/system/systemd-resolved.service.wants/resolvconf-pull-resolved.service → /lib/systemd/system/resolvconf-pull-resolved.service.
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for resolvconf (1.84ubuntu1) ...

Step 3: Start the resolvconf service by using the following command

root@linuxhelp:~# systemctl start resolvconf.service

Step 4: Enable the resolvconf service by using the following command

root@linuxhelp:~# systemctl enable resolvconf.service
Synchronizing state of resolvconf.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable resolvconf

Step 5: Check the status of the resolvconf service

root@linuxhelp:~# systemctl status resolvconf.service
● resolvconf.service - Nameserver information manager
     Loaded: loaded (/lib/systemd/system/resolvconf.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sat 2021-10-30 22:53:19 IST; 1min 55s ago
       Docs: man:resolvconf(8)
   Main PID: 6298 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 2257)
     Memory: 0B
     CGroup: /system.slice/resolvconf.service

Oct 30 22:53:19 linuxhelp systemd[1]: Started Nameserver information manager.
Oct 30 22:53:19 linuxhelp resolvconf[6303]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not>

Step 6: Enter the nameservers in the resolv.conf.d by using the following command

root@linuxhelp:~# nano /etc/resolvconf/resolv.conf.d/head 

Step 7: Update the resolvconf by using the following command

root@linuxhelp:~# resolvconf -u

Step 8: Check the nameserver entry reflected in resolv.conf

root@linuxhelp:~# nano /etc/resolv.conf 

By this How to set permanent DNS nameservers on Ubuntu 21.04 comes to end

Tags:
elijah
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

Why DNS entry in resolv.conf disables ?

A

It is a dynamic file, resolv.conf , on every reboot it auto resets to its default settings.

Q

Where is the location of static DNS file ?

A

It is located in /etc/resolvconf/resolv.conf.d/

Q

What is meant by DNS?

A

DNS, or the domain name system, is the phonebook of the Domains.

Q

How to Find My DNS Server IP Address

A

We can find DNS Server IP Address by using following command "cat /etc/resolv.conf"

Q

What is Resolvconf?

A

It is file used in various operating systems to
configure the system's DNS resolver

Related Tutorials in How to set permanent DNS nameservers on Ubuntu 21.04

Related Tutorials in How to set permanent DNS nameservers on Ubuntu 21.04

How to install Meld tool in Ubuntu
How to install Meld tool in Ubuntu
Feb 25, 2017
How to install Dconf-Editor on Ubuntu 18.04
How to install Dconf-Editor on Ubuntu 18.04
Jul 14, 2018
How to install and update OpenSSL on Ubuntu 16.04
How to install and update OpenSSL on Ubuntu 16.04
Mar 9, 2017
How to install GLib 2.0 on Ubuntu 17.04
How to install GLib 2.0 on Ubuntu 17.04
May 22, 2017
How to Install Android Emulator on Ubuntu 20.4.1
How to Install Android Emulator on Ubuntu 20.4.1
Jul 13, 2021
How To Install AnyDesk on Ubuntu 16.04
How To Install AnyDesk on Ubuntu 16.04
Apr 4, 2018
How to install Genymotion 2.12.1 on Ubuntu 18.04
How to install Genymotion 2.12.1 on Ubuntu 18.04
Jul 9, 2018
How to install Timeshift 18.4 on Ubuntu 18.04
How to install Timeshift 18.4 on Ubuntu 18.04
Jul 6, 2018

Related Forums in How to set permanent DNS nameservers on Ubuntu 21.04

Related Forums in How to set permanent DNS nameservers on Ubuntu 21.04

Ubuntu
matthew class=
Failed to enable unit: Refusing to operate on linked unit file sshd.service
Apr 15, 2019
Ubuntu
mason class=
Passwd: You may not view or modify password information for root On Ubuntu 19.04
May 27, 2019
Ubuntu
isaac class=
/etc/apt/sources.list Permission denied
May 18, 2017
Ubuntu
yousuf class=
lsb_release command not working : Debian
Jan 18, 2018
ifconfig command
jackbrookes class=
what is the location of the ifconfig program on your machine?
Jan 4, 2018
Ubuntu
mason class=
"E: Package 'php-mcrypt' has no installation candidate" error on Ubuntu 20.4.1
Mar 15, 2021
NFS
luke class=
clnt_create: RPC: Program not registered
Apr 25, 2017
Apache
isaac class=
How to disable apache welcome page on Ubuntu
Dec 15, 2018

Related News in How to set permanent DNS nameservers on Ubuntu 21.04

Related News in How to set permanent DNS nameservers on Ubuntu 21.04

How To Install Mixxx on Ubuntu 16.04
How To Install Mixxx on Ubuntu 16.04
Oct 11, 2017
Ubuntu 17.04 released with greater expectations
Ubuntu 17.04 released with greater expectations
Apr 15, 2017
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Mar 1, 2017
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Sep 2, 2017
Ubuntu Unity is no more: One Linux dream has been axed
Ubuntu Unity is no more: One Linux dream has been axed
Apr 7, 2017
What’s next for Ubuntu Linux Desktop?
What’s next for Ubuntu Linux Desktop?
Apr 11, 2017
Say Hi to Ubuntu's new mascot
Say Hi to Ubuntu's new mascot
Mar 22, 2019
KDE Connect App was removed from Google Play Store and brought back in 24 hours
KDE Connect App was removed from Google Play Store and brought back in 24 hours
Mar 22, 2019
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Sebastian ?
How to change non required to required field in SuiteCRM Custom/Default Modules

How to change not required to the required field in SuiteCRM Custom/Default Modules?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.