Tuesday, October 3, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  6] [ 0]  / answers: 1 / hits: 42987  / 1 Year ago, wed, june 8, 2022, 2:48:22

How can I add additional DNS search domains to a network connection which is configured using DHCP?

At work, we have several sub-domains (test.example.com, dev.example.com, etc), and I've grown tired of perpending the sub-domain every time I need to access a server in one of the sub-domains.

More From » networking


Sorin's answer and Ib33X's answer are correct if you are not using the Network Manager. If you are using the Network Manager, then it appears that the Network Manager completely controls generation of the resolv.conf file (which is ultimately what the networking system uses for dns lookups). Changing the dhcpclient.conf is ineffective.

However, there is an (imperfect) solution if you are using the Network Manager:

  1. Make note of the DNS servers setup by DHCP by inspecting the resolve.conf file:

    cat /etc/resolv.conf

  2. Right-click on the Network Manager indicator and select Edit Connections...

  3. Select the connection you want to adjust, and click Edit. Depending on the type of the connection, you may have to switch tabs.

  4. In the Editing dialog, switch to the IPv4 Settings tab (or the IPv6 Settings tab if you're using IPv6).

  5. Change the Method from Automatic (DHCP) to Automatic (DHCP) addresses only.

  6. Copy the DNS servers you saved in step #1 into the DSN servers text box (sue commas to separate multiple entries).

  7. Enter each of the domain names to search by into the Search domains text box.

  8. Click Save...

  9. Disconnect and reconnect the connection.

The downsides of this approach is that you must specify both the DNS servers and the search domain names. It isn't possible to still pull the DNS server addresses from DHCP.

Additionally, the settings must be changed for each connection. I don't know of any way of changing the settings for all connections. However, this is often an advantage. For example, you might want different settings for your home wireless network and your work wireless network.

[#44322] Thursday, June 9, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 164
Total Questions: 108
Total Answers: 106

Location: Ghana
Member since Sun, Mar 27, 2022
2 Years ago
bewre questions
Sun, May 14, 23, 13:27, 5 Months ago
Mon, Aug 2, 21, 03:57, 2 Years ago
Thu, Aug 26, 21, 18:05, 2 Years ago
Sat, Aug 6, 22, 21:41, 1 Year ago
Sat, Jul 24, 21, 22:52, 2 Years ago