Re: Change resolv.conf for one particular DHCP server



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.

Stefan
In 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

.



Relevant Pages

  • Re: Change resolv.conf for one particular DHCP server
    ... router is configured to return as DNS server some overloaded servers, ... manually override the DHCP info by adding 192.168.0.1 in /etc/resolv.conf ... where 'wlan0' is your wireless interface name. ...
    (comp.os.linux.networking)
  • Re: Wireless connects but only partially
    ... So the wireless access point is going to use a fixed IP address in the same range as the SBS - 192.168.1.x, and that's going to be an IP that's excluded from your DHCP scope so DHCP doesn't hand it out to a different device. ... Now, the connection is passing from the client PC through the WAP to the SBS, exactly as the wired connection passes through the Ethernet switch to the SBS. ...
    (microsoft.public.windows.server.sbs)
  • RE: ADMT Profile and Client problems
    ... But AD required a DNS server in domain, ... In addition, as you said the the DHCP service also hold at NT side, please ... >>have full admin rights on both domains and the client device too. ...
    (microsoft.public.windows.server.migration)
  • Re: Phantom DNS server
    ... Dilan Weerasinghe wrote their comments ... >> advantage, to use a Windows machine for DHCP and DNS, ... > their DNS server, although all other settings are correct. ...
    (microsoft.public.win2000.dns)
  • Re: How to set a static IP in WM 5.0 on a PPC-6700 ?
    ... I thought I had tried everything, but the "tiacxwln compatible wireless ... Adapters | and look for the adapter with wireless in it. ... I could not get WPA working at all, it seems as though I might as well ... clone a MAC and get DHCP to serve up an IP. ...
    (microsoft.public.pocketpc.wireless)

Loading