usepeerdns with additional nameserver in resolv.conf

407 views
Skip to first unread message

Dave Sheludko

unread,
Jan 20, 2010, 4:19:45 AM1/20/10
to ml...@mlug.org.au
Hi all,

I have the usepeerdns option set in my ppp config to grab DNS server
addresses from my ADSL provider. This works well, but overwrites any
additional static DNS entries in /etc/resolv.conf whenever the connection
comes up. That in turn causes my DHCP server to stop sending the local DNS
server's address to clients on the LAN, which means that they no longer
have name resolution for the internal view of my domain (other machines on
the LAN). (Internet DNS still works fine, since they get sent the ISP's
server addresses.)

In the past I remember adding an entry or option (somewhere in /etc/ppp I
think?) which enabled pppd to still grab dns servers from my ISP and add
them to /etc/resolv.conf, but leave the local "nameserver 192.168.10.1"
line alone in /etc/resolv.conf. I've googled my fingers raw but can't seem
to find how I managed to get ppp to add the extra nameserver. I know I
could switch to static DNS, but would prefer to leave it ISP-assigned in
case they're changed in the future, and just add my private one in the
first line of /etc/resolv.conf

Any ideas?

TIA,

Dave.

Rick Miles

unread,
Jan 20, 2010, 3:07:19 PM1/20/10
to mlu...@googlegroups.com
There may be a right way but fast and dirty is a script at the end of your boot.
Most distros have a script for such things which is called at the very end of the
boot process but before the xsession. In slacckware it is /etc/rc.d/rc.local. I
can either add a command to that or th name of a scripted located somewere else.

In your situation I would add a line to rc./local that looks something like this:
cat "line of text" >> /etc/resolve.conf
to add a a line at the end of the file, or:
cat "line of text" > which will essentially begin a new file/1st line with
existing contents "deleted".

I could rewrite the whole thing on the fly at the end of the boot regardless of
what has previously been written during boot if I start a ">" and follow for every
other line with a ">>"

The local script will be run as root so if you want to make friends and influence
people you could put the line
telinit 6
in someone elses local script, then hide behind a bush to watch the fun or go home
early.


--
Cheers,

Rick Miles

Written on Sweetmorn, the 21st of Chaos, 3176
http://turtlespond.net
http://rickmiles.com.au

Dave Sheludko

unread,
Jan 20, 2010, 4:21:50 AM1/20/10
to mlu...@googlegroups.com

Dave Sheludko

unread,
Jan 20, 2010, 4:28:17 PM1/20/10
to mlu...@googlegroups.com
<snip>

> In your situation I would add a line to rc./local that looks something
> like this:
> cat "line of text" >> /etc/resolve.conf
> to add a a line at the end of the file, or:
> cat "line of text" > which will essentially begin a new file/1st line
> with
> existing contents "deleted".
>

Thanks Rick - that's actually what I'm doing at the moment, but was hoping
someone knew the right/nice way :) For now I'll stick with the kludge, but
will keep googling just in case...

cheers,

dave.

Rick Miles

unread,
Jan 22, 2010, 7:14:24 AM1/22/10
to mlu...@googlegroups.com
There's some kludges, I've used for yonks, aftert awhile I use them just to thumb
my nose at those who know better but for now I've just turned on the light after
T'wood -3-3 to find that what I thought was a bit of kaffir lime on my k'board
was actually a bit of chocolate veneer off my eskimo piet nmelting into my
keyboard.

> cheers,
>
> dave.
>

--
Cheers,

Rick Miles

Written on Boomtime, the 22nd of Chaos, 3176
http://turtlespond.net
http://rickmiles.com.au

Reply all
Reply to author
Forward
0 new messages