-
Debian DNS issue
Hi,
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?
Cheers,
Sauce
BTW: If I bring up eth0 first, then wlan0 it works, but I'm sure there's a better way to do this...
-
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:
Code:
#!/bin/sh
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.
Jason
-
Thanks
Jason,
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)