You are not logged in.

#1 2009-08-27 11:19:08

PuercoPop
Member
Registered: 2009-08-27
Posts: 9

Using dhcp and choosing your own DNS setting[solved]

Hi,
I'm using dhcp to configure my network at boot-up but I would to set the dns myself (so I can use the opendns ones).
How is this done with arch linux? In gentoo I had no dns option.
I've tried using the /etc/resolv.conf.head to set them, but the dns of my ISP still appear below it.

Thanks for your time in Advance.

Last edited by PuercoPop (2009-08-28 05:03:08)

Offline

#2 2009-08-27 11:24:32

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: Using dhcp and choosing your own DNS setting[solved]

from man dhcpd.conf

nohook script
             Don't run this hook script.  Matches full name, or prefixed with
             2 numbers optionally ending with .sh.

             So to stop dhcpcd from touching your DNS or MTU settings you
             would do:-
                   nohook resolv.conf, mtu

Offline

#3 2009-08-27 11:56:31

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: Using dhcp and choosing your own DNS setting[solved]

There's also a Wiki article for this.  It may also be useful to read through the thread quoted at the bottom of the article.

http://wiki.archlinux.org/index.php/OpenDNS


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#4 2009-08-27 14:36:43

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Using dhcp and choosing your own DNS setting[solved]

Hmm, removing domain_name_servers from /etc/dhcpcd.conf should work but it looks like there is a bug in dhcpcd.  This is the second time I've seen a post that /etc/resolve.conf.head isn't prepending dnsservers to /etc/resolv.conf).  Works alright for me, here's mine just for reference:

nameserver 127.0.0.1
nameserver 208.67.222.222
nameserver 208.67.220.220

You might want to let roy know about this.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#5 2009-08-27 16:01:51

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Using dhcp and choosing your own DNS setting[solved]

i stumbled upon this some days ago. tried this: http://wiki.archlinux.org/index.php/Network#For_DHCP_IP
neither the -C switch nor omitting domain_name_servers in dhcpcd.conf worked for me.
the "nohook resolv.conf" entry did it finally.

Last edited by DonVla (2009-08-27 16:03:09)

Offline

#6 2009-08-28 05:02:41

PuercoPop
Member
Registered: 2009-08-27
Posts: 9

Re: Using dhcp and choosing your own DNS setting[solved]

Thanks everyone for your input, I had tried just removing the domain_name_servers but with out adding the resolv.conf.head dhcpd fails on timeout.  I was trying just to leave the info on resolv.conf thinking dhcp wouldn't touch it. Well it now works.

I feel like a noob for not RTFM!

Last edited by PuercoPop (2009-08-28 05:03:24)

Offline

Board footer

Powered by FluxBB