Wednesday, February 11, 2009

Hooray, /etc/resolv.conf fixed!

A few things have been bothering me about my Linux install recently, so I spent about an hour fixing them this morning.

First, when I mistype a domain name or tried to visit a work web site while disconnected from the intranet, up popped the infamous Rogers search page. I'd put up with it long enough, and finally did what I should have done long ago: modify my router with static DNS, using these addresses
  • 4.2.2.1
  • 4.2.2.2
  • 4.2.2.3
Now I just get a good old fashioned "address not found" page load error. To whoever pays for the upkeep and maintenance of this service, Thank you, Thank you, Thank you.

Second, now that I've upgraded to Ubuntu Intrepid, vpnc did not seem to work as well as it did with Hardy. I think the dots are connected like this:
  • My router is configured to use DHCP to get an IP address from Rogers.
  • DHCP tells my router to use domain phub.net.cable.rogers.com
  • Network Manager uses /sbin/dhclient-script to add "domain phub.net.cable.rogers.com" and "search phub.net.cable.rogers.com" to /etc/resolv.conf when it gets an IP address from my router.
  • When I connect to work with vpnc, the domain line is replaced, but the search line is not
  • Consequently, "ping foo" fails, while "ping foo.work.com" works
After a bit of searching, the thing to do is this: apt-get install resolvconf. That installs a package that, if your VPN gateway sends some DNS server data, will fix up /etc/resolv.conf. So now when I'm connected to work, rogers is no longer searched.

No comments: