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:
- Updating the Debian 12 Package Repository Cache
- Installing Resolvconf on the Debian 12 Server
- Configuring the DNS Nameservers and DNS Search Domain for the Network Interfaces of the Debian 12 Server
- Applying the DNS Nameserver and DNS Search Domain Network Changes to Debian 12
- Conclusion
Updating the Debian 12 Package Repository Cache
To update the Debian 12 package repository cache, run the following command:
Installing Resolvconf on the Debian 12 Server
To install resolvconf on the Debian 12 server, run the following command:
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:
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:
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:
To reboot your Debian 12 server system, run the following command:
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.