LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Remembering network settings (https://www.linuxquestions.org/questions/linux-newbie-8/remembering-network-settings-54698/)

ShakyJake 04-12-2003 10:29 AM

Remembering DNS settings
 
I am a total Linux newbie, however I use to be real good with a DOS prompt.

Anyhoo, how does one make Linux keep network settings? For example, I will run NETCONF and enter the DNS address that I need to access DSL. However, upon reboot the DNS address is gone and reset back to whatever was there before.

Thanks!!

Oh, by the way, I'm using Mandrake 9.1 if that makes a difference.

MasterC 04-12-2003 11:16 AM

You might have it setup to use DHCP which will automatically remove all entries in /etc/resolv.conf upon reboot. If your ISP's DHCP server isn't sending the DNS info at the same time of IP resolution, you can probably either try:

1. Putting something like:
echo "nameserver 1.2.3.4" >> /etc/resolv.conf
echo "nameserver 5.6.7.8" >> /etc/resolv.conf

And so on, replacing 1.2.3.4 with the IP of the DNS server.

You can place that in /etc/rc.local and then upon startup I think it will place those entries in the appropriate file (/etc/resolv.conf).

There is probably an easier way, this is just 1 idea.

Also, tell us how you get an IP (dynamic host configuration protocol - DHCP or PPP or what).

Cool

ShakyJake 04-12-2003 01:58 PM

Yes, it's DHCP. For the Windows machines in the office I have to plug in the DNS address in order to gain internet access.

I tried what you suggested, although I suspect I may be doing something wrong. The output of the "echo" generated NAMESERVER <address>. I placed that in the rc.local file, but the system still doesn't keep the DNS address. It looks like it defaults to some values that Mandrake put in some configuration file.

Any other ideas? Isn't there a network config file around somewhere that can be edited to accept this DNS address as the default?

Thanks.

MasterC 04-13-2003 12:39 AM

I'm not quite sure if I was clear.

Open up (in a text editor) your /etc/rc.local file and add the following (replacing 1.2.3.4 with actual IP and such):
echo "nameserver 1.2.3.4" >> /etc/resolv.conf
echo "nameserver 5.6.7.8" >> /etc/resolv.conf

Save and exit. Now, during bootup it should echo those 'nameserver 1.2.3.4' entries into the /etc/resolv.conf file making the DNS servers already there (no need to run netconf each time).

Other ideas might include checking out the network configurator in the Mandrake Control Center, however I think that if you have to plug these values in manually (regardless of OS) then the echo is going to be along the lines of "your best shot" for now. If I am mistaken, and in win you just boot up using DHCP and the values for DNS are already there, then please let me know.

Cool

ShakyJake 04-13-2003 10:07 AM

Thanks for the reply, but still doesn't work. I placed the echo statement in the rc.local file, but Linux is still overwriting resolv.conf with it's own settings. I've even tried setting resolv.conf as read-only and it STILL gets blown away.

It appears that Linux is obtaining these DNS addresses from the DHCP but the thing is, the addresses obtained are WRONG. I need to manually enter the correct address and have it stick and not be changed next time I reboot.

I'm a bit confused because in Windows this is an extremely simple thing to do. I/we have got to be missing something.

Thanks for your time.

sopiaz57 04-13-2003 09:48 PM

sounds like a problem i would goto the ISP with. Shouldnt they be sending the correct DNS?


All times are GMT -5. The time now is 03:52 AM.