Change resolv.conf for one particular DHCP server
- From: Stefan Monnier <monnier@xxxxxxxxxxxxxxxx>
- Date: Tue, 21 Aug 2007 14:54:10 -0400
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.
Stefan
.
- Follow-Ups:
- Prev by Date: Re: Ubuntu live cd not connecting to the internet...!!!
- Next by Date: Re: Difficulty recovering from DSL loss of sync
- Previous by thread: route newbie question
- Next by thread: Re: Change resolv.conf for one particular DHCP server
- Index(es):
Relevant Pages
|