Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Debian DNS issue


    I have configured my notebook with both a wireless and wired network card, and they work, however I've got a DNS problem when using both at the same time. Whenever I bring up the wireless connection (DHCP) it overwrites /etc/resolv.conf, so I can't access the outside world (the wireless is over IPSEC for an internet network). I'm running Debian testing (sarge) with kernel 2.4.27-1-686. I've tried to hardcode the dns settings in /etc/network/interfaces by adding the line:

    nameserver 150.203.XXX.XXX 150.203.XXX.XXX

    to the wired interface, but with no success. Can anyone help?



    BTW: If I bring up eth0 first, then wlan0 it works, but I'm sure there's a better way to do this...

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    London, UK
    Ive just had a look at /sbin/ifup (assuming your using that to bring up the wlan) and found out that what it does after configuring DHCP is execute any scripts in the /etc/network/if-up.d/ directory. My suggestion would be to create this new script in that directory, and chmod 755 to make it executable:

    echo "nameserver x.x.x.x" > /etc/resolv.conf
    echo "nameserver x.x.x.x" > /etc/resolve.conf
    obviously replacing x.x.x.x with your name server addresses. This should have the effect of re-writing the /etc/resolv.conf after dhclient has wiped it out in the first place.

    btw, run /sbin/ifup -v eth0 to see what ifup actually does, same applies for ifdown.


  3. #3



    Thanks very much for that - works great!

    BTW: I had to add a line to delete a route in the table that appears when wlan0 comes up (to make it work in this environment).

    Thanks again,

    Silas (aka Sauce)

  4. $spacer_open

Posting Permissions

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