LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-03-2004, 02:48 PM   #1
michaelg
LQ Newbie
 
Registered: Oct 2004
Location: South Africa
Distribution: Mandrake Linux 10.0
Posts: 2

Rep: Reputation: 0
Setting Static DNS with Dynamic IP


I am using Mandrake Linux 10.0, Kernel 2.6.3. My computer is linked to a network which assigns IP addresses using DHCP. However, for some strange reason, DHCP does not give my machine the correct DNS server addresses (this happens under Windows as well). I therefore want to set the DNS servers manually, but allow my IP to be set by DHCP. I can set the DNS addresses correctly, but the problem is that they get erased and set to the incorrect addresses whenever the DHCP lease is renewed. This results in my having to manually change the DNS settings every 30min, which can get extremely irritating. I have tried setting DNS in /etc/sysconfig/network; /etc/sysconfig/network-scripts/ifcfg-eth0 and in Mandrakelinux Control Centre, and none remain after the lease is renewed. Is there a way to force the DNS addresses not to be set according to DHCP?
 
Old 10-03-2004, 04:26 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
assuming you're using dhcpcd to get the IP, you need to add a "-R" to the dhcp options. I think that this is actually a common switch by definition of the DHCP client standards. i believe you can set this as a parameter in /etc/sysconfig/network-scripts/ifcfg-eth0 but i've not touched mandrake for a fair while now, so i'm not sure.
 
Old 10-04-2004, 01:49 AM   #3
michaelg
LQ Newbie
 
Registered: Oct 2004
Location: South Africa
Distribution: Mandrake Linux 10.0
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks. I am using dhcpcd. I've added the switch in the ifup script and the connection is working. Will have to wait and see if the settings stay.
 
  


Reply



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
Dynamic IP to Static Temujin_12 *BSD 2 06-10-2005 04:58 PM
Setting up a dynamic dns server countcobolt Linux - Networking 2 02-04-2004 03:29 AM
Static vs Dynamic Big Al Linux - Networking 2 12-08-2003 03:10 PM
NS with static or dynamic IP cijunet Linux - Networking 3 05-08-2003 11:04 PM
DNS, NIS, Static <-> Dynamic DHCP, Proxy bjc Linux - Networking 5 11-12-2000 05:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:29 AM.

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
Open Source Consulting | Domain Registration