This can be useful in cases where multiple local DNS are used, but the DHCP server can't be configured to handle that properly (e.g. DHCP is router or Windows, etc).
1) Edit dhclient.conf:
- Debian: /etc/dhclient.conf
- Ubuntu: /etc/dhcp3/dhclient.conf
Code: Select all
supersede domain-name "mydomain.local";
prepend domain-name-servers 127.0.0.1;
And the domain-name-server IP to point to your desired DNS.
I've left localhost "127.0.0.1", because that's a very popular case for this.
3) Restart the network interface:
For example for "eth0":
Code: Select all
$ ifdown eth0
$ ifup eth0
Configuring Static DNS with DHCP on Debian/Ubuntu (by Raam Dev)