Re: Change resolv.conf for one particular DHCP server
- From: M4teK <rejek@xxxxxxxxxxxx>
- Date: Fri, 24 Aug 2007 03:52:01 -0700
On 22 Sie, 19:54, Stefan Monnier <monn...@xxxxxxxxxxxxxxxx> wrote:
My laptop is configured in the usual way to get his IP and DNS servers
by DHCP. But there's a cybercafé to which I like to go who's wireless
router is configured to return as DNS server some overloaded servers, even
though the AP is actually running a caching DNS proxy, so I sometimes
manually override the DHCP info by adding 192.168.0.1 in /etc/resolv.conf
just to speed up my connections.
Now, doing it manually is a pain, so I was wondering if anybody has an idea
how I could make this change automatically.
I'm currently using wpa_supplicant + dhclient3 + resolvconf under Debian
testing if that matters.
I'm currently using an ugly hack:
#!/bin/sh
resolvconf=/etc/resolvconf/run/resolv.conf
trigger_re="nameserver 4\\.2\\.2\\.2"
extraline="nameserver 192.168.0.1"
(rm "$resolvconf";
sed "/$trigger_re/i# Next line added by $0\\n$extraline" \
"$resolvconf" ) <"$resolvconf"
in /etc/resolconf/update-libc.d and was wondering if there's
a cleaner solution.
StefanIn file /etc/dhclient.conf put
lease
{
interface "wlan0";
option domain-name-servers 153.19.250.100;
}
where 'wlan0' is your wireless interface name.
But that will be used everywhere, right? I only want to change the
resolv.conf when I use the machine at that one cybercafé. The 192.168.0.1
address I need to use there doesn't even work in most other places (at
home and at work, at least).
Stefan
yes, you are right
as far as I know there is no possibility to do conditional changes
via dhclient.conf file, but on every dhcp update there can be some
script started, so check this way
MR
.
- References:
- Change resolv.conf for one particular DHCP server
- From: Stefan Monnier
- Re: Change resolv.conf for one particular DHCP server
- From: M4teK
- Re: Change resolv.conf for one particular DHCP server
- From: Stefan Monnier
- Change resolv.conf for one particular DHCP server
- Prev by Date: Re: telnet session times out
- Next by Date: Re: Squirrelmail problem under redhat 9
- Previous by thread: Re: Change resolv.conf for one particular DHCP server
- Next by thread: When windows client send a file (about 150kb) to linux server, after about 40kb is sent they are blocked.
- Index(es):
Relevant Pages
|
Loading