Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Im pretty much a linux newbie, and any advice would be appreciated.
My eth0 card is set to obtain IP from ISP via DHCP..... all well and good. I wanted to set up an internal caching nameserver for my local lan, but resolv.conf seems to be over-written every time i boot up by DHCP.
I run Slackware 8.1.
I have tried adding "prepend domain-name-servers 127.0.0.1" in the dhclient.conf file, and adding the -R option to DHCP start-up in inet1.dc for eth0, i.e.
I'm not quite sure what you want to do exactly. Since you are getting a dhcp IP from your provider. It will over-write the resolv.conf file everytime you bootup. Because, their dhcp server need to put their DNS servers entry in the file so you could browse the internet by name.
If you are trying to browse your local network by name. You don't need to setup an internal caching nameserver. All you have to do is insert the line
option domain-name-server xxx.xxx.xxx.xxx(your provider dns IP)
And if you have windozes machine on your lan. You will need to install Samba and turn WINS on with Samba.
If I'm totally off what you are trying to do. Give me more info.
Thank you for your replies. It's really nice of you to take the time to help out newbies.
Maybe I did not make myself that clear - I simply wanted to set up a local DNS caching server, to speed up browsing. Not particularly as I absolutely NEED to, but more so because I want to explore Linux and start learning about what it can do.
The Linux machine is currently acting as a router to 2 PC's - nothing major :-). Every thing is working fine, except when I follow the HOW-TO guides on setting up a caching name-server I get no joy, as resolv is always over-written.
After exploring BIND I intend trying SAMBA and APACHE - yeah get ready for many more dumb question lol. I have actually tried to read up about the above problem on the net and here before posting... only sometimes there is TOO much info and contradictory advice, that you simply don't know where to begin.
So anyway I will try you suggestions, and report back if they are successful or not.
Cojo, you method almost works! I get 127.0.0.1 now added to my resolv.conf file when i boot up. perfect, except for the fact that it appears LAST on the list (my ISP's first 2 DNS addresses entered by DHCP appear first).
If I want to set up an internal caching only DNS server I think I need the order reversed and so have nameserver 127.0.0.1 appearing first. Otherwise I will always use my ISP's cach first.
Its only a matter of a few ms difference.... but i really want ed to get this to work! Any further ideas?
DHCP usually contains a script (dhclient-script, in a default debian distro, using dhclient-2.2.x) somewhere in the /etc directory probably, which will re-write /etc/resolv.conf from a function within the script, each time it is run.
I advise you to find your dhcp client's config files and scripts, and search them for anything that would be over writing the resolv.conf file. (Should be fairly obvious). Then edit that.
I solved this one by telling it not to overwrite at all.
Stick your name server at the top of the file, stick 2 or 3 of your ISP's nameservers beneath it and tell dhcpd not to overwrite (-R).
The ip address of the name servers won't change. On account of um.. they're nameservers
Given two or three if one of them goes down, you should be good, and you'll be even better because you'll only ever hit *yours* anyway and it'll have cached addresses you've been to before.
(as long as you have your own set to forward unknown requests to your ISP's ns's).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.