LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 11-24-2009, 11:03 AM   #1
Cybrax
LQ Newbie
 
Registered: Oct 2009
Posts: 11

Rep: Reputation: 0
Question Updating DHCP with an extra nameserver


Hello Linux Guru's,

Im facing a little problem on my debian box, My ISP connection is with DHCP and receieves its ip and nameserver from my provider, this is all working fine but i also run my own bind for some local names.

Now at first i had added my own machine to /etc/resolv.conf and this worked fine but after a while i found out that the dhcpclient updates this file (obviously) but also removes my custom ns i added.

After searching i came across some information on how to hook scripts using
/etc/dhcp3/dhclient-enter-hooks.d it involved overriding the function

make_resolv_conf(

however when i do this the nameserver from the ISP are no longer updated to my resolv.conf and this is not what i want.

if i use my nameservers alone, i can no longer relove names on the net ofcourse and im not so experienced yet to configure bind dynamicaly to forward to my ISP

Basically what i want is my own nameserver always standard first and appended to that the ns of my ISP.

Maybe someone could point me in the right direction.

Thank you
Cybrax.
 
Old 11-24-2009, 11:17 AM   #2
toynbee
Member
 
Registered: Jan 2007
Location: Maryland
Distribution: Arch and Red Hat
Posts: 34

Rep: Reputation: 17
I've had a similar problem in the past. I found this which offers a few different methods for dealing with your problem:
http://forums.debian.net/viewtopic.php?t=7239
 
Old 11-24-2009, 11:54 AM   #3
Cybrax
LQ Newbie
 
Registered: Oct 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by toynbee View Post
I've had a similar problem in the past. I found this which offers a few different methods for dealing with your problem:
http://forums.debian.net/viewtopic.php?t=7239
Thank you, however if you see my post you kind of see that is already how far i got, the problem is however the resolv.conf needs to be updated with my ISP NS because they can change.

So this does not really solve my problem.

However the little line echo "doing nothing to resolv.conf" in the link you posted did bring me to an idea

i could use grep like gettig ip from ifconfig
then write my own NS first then the NS from grep to resolv.conf

however ill have to figure out how i fix that because it seems ifconfig doesnt show ns by defualt

Thank you i guess i manage from here i was on the right way.
 
Old 11-24-2009, 01:06 PM   #4
Cybrax
LQ Newbie
 
Registered: Oct 2009
Posts: 11

Original Poster
Rep: Reputation: 0
here is my override function
it works ok but the problem im facing is how do i get the nameservers for my isp without taking it from resolv.conf i tried grep with ifconfig but it does not seems to be specified there

Code:
#!/bin/sh
make_resolv_conf(){
        rm /etc/resolv.conf
        touch /etc/resolv.conf
        echo "127.0.0.1" >> /etc/resolv.conf

        # how to get ns without resolv.conf?
        NS1 = ifconfig eth0 | grep 'nameserver1'
        NS1 = ifconfig eth0 | grep 'nameserver2'
       

        echo $NS1 >> /etc/resolv.conf
        echo $NS2 >> /etc/resolv.conf
}
 
  


Reply

Tags
bind, dhcp, dns


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcp not updating dns.... rwazar Linux - Networking 29 07-10-2008 12:47 PM
updating DHCP vortmax Linux - Server 5 03-05-2008 06:04 PM
Adding a backup nameserver when normally DHCP. Bryan88 Linux - Networking 1 01-18-2007 12:39 PM
updating fedora with extra soumyadeep Fedora 10 08-23-2005 01:35 PM
How do I assign an additional nameserver while using dhcp? Flatredline Linux - Networking 2 11-25-2003 12:07 PM


All times are GMT -5. The time now is 03:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration