You are not logged in.

#1 2008-03-13 00:14:38

paulfxh
Member
Registered: 2008-03-11
Posts: 33

[Solved] Although I'm using DHCP I want fixed DNS

I'm using a wired internet connection (eth0) configured as dhcp and this works fine.
However, I don't want dhcp to choose my DNS servers.
In other distros, I can get around this by adding my preferred DNS addresses as prepends in the /etc/dhcp3/dhclient.conf file (or it may be /etc/dhclient.conf).
However, I can't find anything equivalent here in ArchLinux.
Can somebody please advise me how to do this.
Thanks
Paul

Last edited by paulfxh (2008-03-13 20:20:44)

Offline

#2 2008-03-13 00:16:45

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: [Solved] Although I'm using DHCP I want fixed DNS

Add "-R" to DHCPCD_ARGS in /etc/conf.d/dhcpcd, then set up your nameservers as usual in /etc/resolv.conf.

Offline

#3 2008-03-13 00:18:20

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: [Solved] Although I'm using DHCP I want fixed DNS

If you use DHCP and you don't want your DNS servers to change every time you start your network, add the "-R" option to DHCPCD_ARGS in /etc/conf.d/dhcpcd (used by /etc/rc.d/network). This prevents DHCP from rewriting your /etc/resolv.conf every time:

DHCPCD_ARGS="-R -t 30 -h $HOSTNAME"

From http://wiki.archlinux.org/index.php/Configuring_network

Offline

#4 2008-03-13 08:11:28

paulfxh
Member
Registered: 2008-03-11
Posts: 33

Re: [Solved] Although I'm using DHCP I want fixed DNS

Thank you for the replies.
That worked perfectly for me.
For any other newbie who may be wondering why I want to do this, my browser works abominably slowly without this.

Offline

#5 2008-03-13 08:32:41

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: [Solved] Although I'm using DHCP I want fixed DNS

If you're using netcfg2, just specify your DNS options in your profile, and it will prevent dhcp overwriting them.

Offline

#6 2008-03-26 21:27:31

mico
Member
From: Slovenia
Registered: 2004-02-08
Posts: 247

Re: [Solved] Although I'm using DHCP I want fixed DNS

iphitus wrote:

If you're using netcfg2, just specify your DNS options in your profile, and it will prevent dhcp overwriting them.

How exactly do I do that? I just want to keep old /etc/resolv.conf and whatever contents it has, including comments. I know only how to set specific DNS servers with DNS1 and DNS2 options.

BTW, why doesn't netcfg respect arguments in /etc/conf.d/dhcpcd ?

Offline

Board footer

Powered by FluxBB