Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Travel router part 2



On 04/09/2018 23:21, Brett Lymn wrote:
On Sun, Sep 02, 2018 at 11:55:58AM -0400, D'Arcy Cain wrote:

Any thoughts on picking up the DNS servers?  It's not too bad because my
DHCP server can be modified as needed so it is only one location and in
any case I always include Google's public servers.


I have found that DNS can be problematic when travelling, some places
force you through their DNS regardless and do all sorts of lossage.
what I do on my laptop is run a local named and configure forwarders to
the DNS provided so I can override some of the random lossage.  I have a
dhclient (yeah, old habits..) enter script that does:

restore_resolv_conf() {
         # We don't want /etc/resolv.conf changed
         # So this is an empty function
         return 0
}

make_resolv_conf() {
         if [ -f /etc/namedb/forwarders ]
         then
                 mv /etc/namedb/forwarders /etc/namedb/forwarders.old
         fi

         printf "forwarders { " > /etc/namedb/forwarders
         for nameserver in $new_domain_name_servers
         do
                 printf "%s; " ${nameserver} >> /etc/namedb/forwarders
         done
         echo "};" >> /etc/namedb/forwarders
         echo "forward only;" >> /etc/namedb/forwarders

         pkill -HUP named
         return 0
}

and have a named configured to use the forwarders in
/etc/namedb/forwarders.  Whatever the ISP dhcp gives me is stuffed into
the forwarders and used as last resort.  This has been a robust solution
for many open wireless access points.

Since NetBSD-6, dhclient-script has shipped with resolvconf(8) support that will do that for you.

Roy


Home | Main Index | Thread Index | Old Index