Debian

How to Install Resolvconf on Debian 12

To configure the DNS nameservers and DNS search domain using the “/etc/network/interfaces” file on the Debian 12 server operating system, you need to have the “resolvconf” program installed on your Debian 12 server.

In this article, we will show you how to install the “resolvconf” program on the Debian 12 server operating system so that you can easily manage the DNS nameservers and DNS search domain using the “/etc/network/interfaces” file.

Topic of Contents:

  1. Updating the Debian 12 Package Repository Cache
  2. Installing Resolvconf on the Debian 12 Server
  3. Configuring the DNS Nameservers and DNS Search Domain for the Network Interfaces of the Debian 12 Server
  4. Applying the DNS Nameserver and DNS Search Domain Network Changes to Debian 12
  5. Conclusion

Updating the Debian 12 Package Repository Cache

To update the Debian 12 package repository cache, run the following command:

$ sudo apt update

 

Installing Resolvconf on the Debian 12 Server

To install resolvconf on the Debian 12 server, run the following command:

$ sudo apt install resolvconf -y

 

Resolvconf is being installed on your Debian 12 server. It takes a few seconds to complete.

Resolvconf should be installed on your Debian 12 server at this point.

For the changes to take effect, reboot your Debian 12 server system as follows:

$ sudo reboot

 

Configuring the DNS Nameservers and DNS Search Domain for the Network Interfaces of the Debian 12 Server

To configure the DNS nameservers and default DNS search domain for a network interface of your Debian 12 server, open the “/etc/network/interface” file with the nano text editor as follows:

$ sudo nano /etc/network/interface

 

The “/etc/network/interface” file should be opened with the nano text editor.

You can use the “dns-nameservers” option to set the primary and secondary DNS nameservers for your desired network interface. You can use the “dns-search” option to set a default DNS search domain for your desired network interface as well. For more information on setting up a static/fixed IP address on your Debian 12 server using the “/etc/network/interface” file, read this article.

Applying the DNS Nameserver and DNS Search Domain Network Changes to Debian 12

To apply the DNS nameserver and DNS search domain changes that you made to your desired network interface using the “/etc/network/interface” file, you can either restart the networking service of your Debian 12 server or reboot your Debian 12 server.

To restart the networking service of your Debian 12 server, run the following command:

$ sudo systemctl restart networking

 

To reboot your Debian 12 server system, run the following command:

$ sudo reboot

 

Conclusion

In this article, we showed you how to install the “resolvconf” program on the Debian 12 server operating system so that you can configure the DNS nameservers and DNS search domains for the network interfaces of your Debian 12 server OS using the “/etc/network/interface” file.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.