Linux: How To Edit resolv.conf Using dhclient.conf

So, you’re trying to get here:

/etc/resolv.conf:
nameserver 192.168.1.1
domain aaa.com
search aaa.com bbb.com

You need to edit dhclient.conf like this:

/etc/dhcp3/dhclient.conf:
supersede domain-name-servers 192.168.1.1;
supersede domain-name "aaa.com";
append domain-name " bbb.com";

There must be a space before the bbb.com

Then run dhclient:

# /sbin/dhclient
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:1b:78:a9:4a:a4
Sending on   LPF/eth0/00:1b:78:a9:4a:a4
Sending on   Socket/fallback
DHCPREQUEST of 192.168.1.19 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.19 from 192.168.1.1
bound to 192.168.1.19 -- renewal in 42626 seconds.

Then look at your new resolv.conf.


This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>