StaticDnsWithDhcp

Differences between revisions 2 and 3
Revision 2 as of 2005-10-01 19:33:35
Size: 772
Editor: seveas
Comment: typo
Revision 3 as of 2005-11-16 10:13:35
Size: 1252
Editor: ksl403-uva-180
Comment: Add the sensible way...
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The default setup of Ubuntu does not make it easy to use static DNS servers while using DHCP. To get this working you need to edit {{{/etc/dhcp3/dhclient.conf}}} The default setup of Ubuntu does not make it easy to use static DNS servers while using DHCP.
If you use the standard ubuntu way of networking (ifupdown), you can edit {{{/etc/network/interfaces}}}

In that file you find the entry for your interface. If your interface is eth0, then look for the following lines:
{{{
auto eth0
iface eth0 inet dhcp}}}

Add one line, so it looks like:
{{{
auto eth0
iface eth0 inet dhcp
dns-nameservers ip.address.of.nameserver}}}

Run
{{{
sudo invoke-rc.d networking restart}}}

To make the changes effective


If you do not use ifupdown, you need to edit {{{/etc/dhcp3/dhclient.conf}}}

The default setup of Ubuntu does not make it easy to use static DNS servers while using DHCP. If you use the standard ubuntu way of networking (ifupdown), you can edit /etc/network/interfaces

In that file you find the entry for your interface. If your interface is eth0, then look for the following lines:

auto eth0
iface eth0 inet dhcp

Add one line, so it looks like:

auto eth0
iface eth0 inet dhcp
dns-nameservers ip.address.of.nameserver

Run

sudo invoke-rc.d networking restart

To make the changes effective

If you do not use ifupdown, you need to edit /etc/dhcp3/dhclient.conf

Find the lines

#prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name,
        netbios-name-servers, netbios-scope;

And change them to

prepend domain-name-servers 1.2.3.4, 1.2.3.5;
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, host-name,
        netbios-name-servers, netbios-scope;

Replace 1.2.3.4 and 1.2.3.5 with the addresses of your DNS servers.

Run

sudo invoke-rc.d networking restart

To make the changes effective

StaticDnsWithDhcp (last edited 2008-08-06 16:59:38 by localhost)