Find the answer to your Linux question:
Results 1 to 6 of 6
I hav got RHEL 5 installed on my system. i have two nic cards in my system. one of the ethernet card is connected to internet provider and another nic ...
  1. #1
    Just Joined!
    Join Date
    May 2011
    Posts
    12

    DNS changes on Reboot

    I hav got RHEL 5 installed on my system. i have two nic cards in my system. one of the ethernet card is connected to internet provider and another nic to another system in lan. I have configured one of the nics to get ip automatically from internet service provider and another nic has got static address. on reboot the static dns and dns search path assigned on second ethernet is also changing, may be coz i hav configured dynamic ip on another nic. in this situation am able to get internet but am not able to communicate with other system in lan. can we not have two different setting as we can hav in windows. plz help.

  2. #2
    Just Joined!
    Join Date
    May 2011
    Location
    Southern California, US
    Posts
    24
    Please post the contents of the file /etc/resolv.conf and the results of the command route. Thanks
    Tom

  3. #3
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Since you are using DHCP to get an ip address form your provider your resolv.conf will always be over-written. There is no stopping this.

    However there is a way to get around this.

    1. Create a resolv.conf.wrk file with the correct settings that you want.
    2. Create a script that copies resolv.conf.wrk to resolv.conf
    3. Have this script run after your internet scripts run to over-write what you are receiving from the ISP's DHCP server

    Problem solved.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  4. #4
    Just Joined!
    Join Date
    May 2011
    Location
    Southern California, US
    Posts
    24
    Try this link: How To: Make Sure /etc/resolv.conf Never Get Updated By DHCP Client
    Option #3 is the coolest way to do it. Just include the DNS server(s) from your ISP, then your local DNS server.

  5. #5
    Just Joined!
    Join Date
    May 2011
    Posts
    12
    thanks guys. i shall try n get back

  6. #6
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    as Peter suggests in tboland's link, the best way to do this to add:

    PEERDNS=no

    to the appropriate ifcfg-ethN file. that's what i do anyway, and it works for me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...