blob: dd99600da0c6cefb62cad817d1392d735e6a788f [file] [log] [blame]
San Mehatffd68722010-01-20 09:56:15 -08001The patch I have attached lets me get the behavior I wish out of
2dnsmasq. I also include my version of dhclient-enter-hooks as
3required for the switchover from pre-dnsmasq and dhclient.
4
5On 8/16/05, Joseph Tate <dragonstrider@gmail.com> wrote:
6> I'm trying to use dnsmasq on a laptop in order to facilitate openvpn
7> connections. As such, the only configuration option I'm concerned
8> about is a single server=3D/example.com/192.168.0.1 line.
9>
10> The way I currently have it set up is I modified dhclient to write its
11> resolv.conf data to /etc/resolv.conf.dhclient and configured
12> /etc/dnsmasq.conf to look there for its upstream dns servers.
13> /etc/resolv.conf is set to nameserver 127.0.0.1
14>
15> All of this works great. When I start the openvpn service, it the
16> routes, and queries to the domain in the server=3D line work just fine.
17>
18> The only problem is that the hostname for my system doesn't get set
19> correctly. With the resolv.conf data written to something other than
20> /etc/resolv.conf, the ifup scripts don't have a valid dns server to do
21> the ipcalc call to set the laptop's hostname. If I start dnsmasq
22> before the network comes up, something gets fubar'd. I'm not sure how
23> to describe it exactly, but network services are slow to load, and
24> restarting networking and dnsmasq doesn't solve the problem. Perhaps
25> dnsmasq is answering the dhcp request when the network starts?
26> Certainly not desired behavior.
27>
28> Anyway, my question: is there a way to have the best of both worlds?
29> DHCP requests to another server, and DNS lookups that work at all
30> times?
31>
32> My current best idea on how to solve this problem is modifying the
33> dnsmasq initscript to tweak /etc/dhclient-enter-hooks to change where
34> dhclient writes resolv.conf data, and fixing up /etc/resolv.conf on
35> the fly to set 127.0.0.1 to the nameserver (and somehow keep the
36> search domains intact), but I'm hoping that I'm just missing some key
37> piece of the puzzle and that this problem has been solved before. Any
38> insights?
39>
40> --
41> Joseph Tate
42> Personal e-mail: jtate AT dragonstrider DOT com
43> Web: http://www.dragonstrider.com
44>