Change resolv.conf for one particular DHCP server




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
.



Relevant Pages

  • Re: DHCP Problem causing ip to be 169.X.X.X and not 192.168.X.X
    ... their configuration to limit the number of clients they will serve DHCP to. ... If your router was set up by your ISP, they may have set this to just the ... and use what it is using for DNS servers. ...
    (microsoft.public.windowsxp.network_web)
  • Re: Netgear RP114 Problem
    ... >> Does your router provide your pc's with an ip address via dhcp? ... By default the rp114 will do dhcp for the first 30 ip addresses or so ... you can set the DNS servers of your ISP. ... can open a port or range of ports to a host. ...
    (Fedora)
  • Re: Need help with sites configuration
    ... DHCP is a real issue. ... All domain controllers have a copy of my DNS zone. ... All my clients have statically configured DNS servers 1 and 2 both on ... Last week I had a problem and the connection from production computers ...
    (microsoft.public.windows.server.active_directory)
  • Re: DHCP setup
    ... If it's the logon time, accessing network drives, and the like, DNS issues are the prime candidate. ... The DHCP settings will dictate the gateway & DNS servers if the workstation is set for automatically finding them. ... found that they're running DHCP via sonicwall appliance. ...
    (microsoft.public.win2000.active_directory)
  • Re: Vista Wireless Internet Issue
    ... I changed the IP address DHCP was giving me to another ... the router is actually a UTM device (internet router, URL filtering, firewall ... I would have expected the Default Gateway to have the same IP address ... While it is perfectly permissible to have different DNS servers (not ...
    (microsoft.public.windows.vista.networking_sharing)