FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 07-13-2012, 07:40 AM
Florin Andrei
 
Default stop updating resolv.conf on DHCP

Multihomed server, external interface on DHCP, internal interfaces with
fixed addresses. Server is running its own DNS resolver with Bind. So
there's no need to update resolv.conf via the DHCP client.


I tried this in /etc/network/interfaces:

auto eth2
iface eth2 inet dhcp
dns-nameservers 127.0.0.1
dns-search home.local

But then the DNS servers and domain provided by DHCP are still added to
resolv.conf in addition to my own. I want to stop that altogether.
resolv.conf must contain only my own DNS server and domain.


Is there a way to do this nicely, only relying on config scripts, or do
I have to do it the hard way, modifying system scripts? (which would suck)


I can't believe there's no obvious solution to this simple problem. On
Red Hat, I would just add PEERDNS=no to the interface config and the
problem would be solved.


--
Florin Andrei
http://florin.myip.org/


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-13-2012, 07:54 AM
Mika Suomalainen
 
Default stop updating resolv.conf on DHCP

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 13.07.2012 10:40, Florin Andrei wrote:
> Is there a way to do this nicely, only relying on config scripts,
> or do I have to do it the hard way, modifying system scripts?
> (which would suck)

I think that the only way is to run this as root:

service resolvconf stop && mv /etc/init.d/resolvconf
/etc/init.d/resolvconf~

- --
Mika Suomalainen

NOTICE! I am on mobile broadband with very limited time, so I cannot
read emails very much.
The best time to contact me is probably weekends when I have better
connectivity with good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Homepage: http://mkaysi.github.com/
Comment: gpg --keyserver pool.sks-keyservers.net --recv-keys 82A46728
Comment: Public key: http://mkaysi.github.com/PGP/key.txt
Comment: Fingerprint = 24BC 1573 B8EE D666 D10A AA65 4DB5 3CFE 82A4 6728
Comment: Why do I (clear)sign emails? http://git.io/6FLzWg
Comment: Please send plaintext instead of HTML. http://git.io/TAc0cg
Comment: Please don't toppost. http://git.io/7-VB3g
Comment: Please remove PGP lines in replies. http://git.io/nvHrDg
Comment: Charset of this message should be UTF-8.
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCgAGBQJP/9QvAAoJEE21PP6CpGcoQk0P/31qVvtKJ9ywhXdd1+Q/zxYC
UHrHJuV0hYCPngqJuSmsILr9tTEmY+MLC5dXil0dstGTCRZMkP 9DV/8XbKNyoHzd
vW8J/oBxUmmNEGhuEUsFffcmvDmmGSL8YDvdcpAol6xpZ3wj+kCLb5C gliUfflSo
9sY58KicRiqASpT2sH31EhbBBC5hvi57kg4gZ4GieBA8n84dR3 uQmyPXziPznb1/
v47JRBCawKv1mv0UwEsIeIGZBS/LV5ZLnLSXUd9G3zEVmd869FWTuai44DbIUIw8
rIANkUZc/fC+IxFQQypcefF7pRKoS4fd0Fet1FttLV8YZvicN8sje1fiCqG u1qA6
xxbNQDz6xVpm6J+2CkUqWTpMHwMp2+8vUYNwpH8Fh7J5qROrvZ MRamYTzhSyols9
Zrrn8X1OKQrJwXzQ8Hi3z4gXAJQa8qnMrvLNhfoke4j4jzDLpK KKojq1xR6IXimX
01Qh+skbQAW4Mb2dGnoMp0saR6zbOg3YQGCbC3EKZQ92fiOyu/6YGfOhhIFYb6u9
KkUv+IagDGDuuJnLNTV45mPbpGCZsFIXojd2oyvsdluJmjvjS2 1V42HvDtTXnBcf
CXjagvqqwLhdPnzhX7tSFZPlLc0MSvhdGRGhtPw2TaKsA43MYw dh8R6lxPiHoFLh
VxqcSVJObBhohzmddLUW
=ys7+
-----END PGP SIGNATURE-----

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-13-2012, 11:06 AM
Gene Heskett
 
Default stop updating resolv.conf on DHCP

On Friday 13 July 2012 07:01:05 Florin Andrei did opine:

> Multihomed server, external interface on DHCP, internal interfaces with
> fixed addresses. Server is running its own DNS resolver with Bind. So
> there's no need to update resolv.conf via the DHCP client.
>
> I tried this in /etc/network/interfaces:
>
> auto eth2
> iface eth2 inet dhcp
> dns-nameservers 127.0.0.1
> dns-search home.local
>
> But then the DNS servers and domain provided by DHCP are still added to
> resolv.conf in addition to my own. I want to stop that altogether.
> resolv.conf must contain only my own DNS server and domain.
>
> Is there a way to do this nicely, only relying on config scripts, or do
> I have to do it the hard way, modifying system scripts? (which would
> suck)
>
> I can't believe there's no obvious solution to this simple problem. On
> Red Hat, I would just add PEERDNS=no to the interface config and the
> problem would be solved.

Can you not do that in your interfaces file now?

I had that sort of a problem once, but took the brute force approach to
solving it. Once I had resolv.conf to my liking, I did a "chmod +i
resolv.conf" as root. My laptops dhcp client didn't complain because it
couldn't write to resolv.conf. But that also means I keep a backup copy
because when I take the lappy someplace else, it does need to be writable.

Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
BOFH excuse #374:

It's the InterNIC's fault.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-13-2012, 11:34 AM
Karl Auer
 
Default stop updating resolv.conf on DHCP

On Fri, 2012-07-13 at 07:06 -0400, Gene Heskett wrote:
> I had that sort of a problem once, but took the brute force approach to
> solving it. Once I had resolv.conf to my liking, I did a "chmod +i
> resolv.conf" as root. My laptops dhcp client didn't complain because it
> couldn't write to resolv.conf. But that also means I keep a backup copy
> because when I take the lappy someplace else, it does need to be writable.

Are you sure? My version of chmod (Ubuntu Maverick) doesn't understand
"+i".

kauer@karl:~$ touch blah.txt
kauer@karl:~$ ls -la blah*
-rw-r--r-- 1 kauer kauer 0 2012-07-13 21:31 blah.txt
kauer@karl:~$ chmod +i blah.txt
chmod: invalid mode: `+i'
Try `chmod --help' for more information.
kauer@karl:~$ sudo chmod +i blah.txt
[sudo] password for kauer:
chmod: invalid mode: `+i'
Try `chmod --help' for more information.
kauer@karl:~$ sudo bash
root@karl:~# chmod +i blah.txt
chmod: invalid mode: `+i'
Try `chmod --help' for more information.

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer@biplane.com.au)
http://www.biplane.com.au/kauer

GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017
Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-13-2012, 11:47 AM
Gene Heskett
 
Default stop updating resolv.conf on DHCP

On Friday 13 July 2012 07:42:12 Karl Auer did opine:

> On Fri, 2012-07-13 at 07:06 -0400, Gene Heskett wrote:
> > I had that sort of a problem once, but took the brute force approach
> > to solving it. Once I had resolv.conf to my liking, I did a "chmod
> > +i resolv.conf" as root. My laptops dhcp client didn't complain
> > because it couldn't write to resolv.conf. But that also means I keep
> > a backup copy because when I take the lappy someplace else, it does
> > need to be writable.
>
> Are you sure? My version of chmod (Ubuntu Maverick) doesn't understand
> "+i".
>

My bad, beat me and make me drink another cup of leftover cold coffee. And
thats what I get for thinking _I_ can think before the 3rd cup of coffee.


Dammit, old age isn't for wimps.

The command is chattr, change attributes. The +i make the file immutable,
and AFAIK, only root can execute it.

Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
Confucius say too much.
-- Recent Chinese Proverb

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-13-2012, 01:45 PM
Adam Wolfe
 
Default stop updating resolv.conf on DHCP

You can also "sudo dpkg-reconfigure resolvconf" and answer "no" to the
question about dynamically updating resolv.conf.

A reboot is sometimes needed after, btw.

On 07/13/2012 08:00 AM, ubuntu-users-request@lists.ubuntu.com wrote:

Re: stop updating resolv.conf on DHCP




--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-13-2012, 10:36 PM
Rashkae
 
Default stop updating resolv.conf on DHCP

On 07/13/2012 03:40 AM, Florin Andrei wrote:

Multihomed server, external interface on DHCP, internal interfaces with
fixed addresses. Server is running its own DNS resolver with Bind. So
there's no need to update resolv.conf via the DHCP client.

I tried this in /etc/network/interfaces:

auto eth2
iface eth2 inet dhcp
dns-nameservers 127.0.0.1
dns-search home.local

But then the DNS servers and domain provided by DHCP are still added to
resolv.conf in addition to my own. I want to stop that altogether.
resolv.conf must contain only my own DNS server and domain.

Is there a way to do this nicely, only relying on config scripts, or do
I have to do it the hard way, modifying system scripts? (which would suck)

I can't believe there's no obvious solution to this simple problem. On
Red Hat, I would just add PEERDNS=no to the interface config and the
problem would be solved.



You have to configure dhcp with /etc/dhcp/dhclient.conf

Of interest to you would be to uncomment the #prepend
domain-name-servers 127.0.0.1;


You can also remove domain-search, domain-name and domain-name-servers
from the request parameter.





--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-14-2012, 03:12 AM
Florin Andrei
 
Default stop updating resolv.conf on DHCP

On 7/13/2012 3:36 PM, Rashkae wrote:


You have to configure dhcp with /etc/dhcp/dhclient.conf
You can also remove domain-search, domain-name and domain-name-servers
from the request parameter.


That's what I ended up doing, and I added dns-nameservers 127.0.0.1 (and
also dns-search foobar) to /etc/network/interfaces. It works.


But it feels contrived. This should be handled entirely in
/etc/network/interfaces.


--
Florin Andrei
http://florin.myip.org/



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 09:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org