Linux Changing DNS Search Order

http‮‬s://www.lautturi.com
Linux Changing DNS Search Order

To change the DNS search order in Linux, you can modify the resolv.conf file, which is the configuration file for the resolv library that handles DNS resolution.

Here's an example of how to change the DNS search order in Linux:

  1. Open the resolv.conf file in a text editor. For example:
sudo vi /etc/resolv.conf
  1. Edit the search line to specify the DNS search domains in the desired order. For example:
search domain1.com domain2.com domain3.com

This will set the DNS search order to domain1.com, domain2.com, and domain3.com.

  1. Save the resolv.conf file and exit the text editor.

Note that the resolv.conf file may be overwritten by your network configuration, so you may need to modify the network configuration instead.

For example, if you are using NetworkManager, you can edit the DNS search domains by modifying the /etc/NetworkManager/NetworkManager.conf file.

Created Time:2017-10-29 22:08:52  Author:lautturi