Thank you so much for that information Perette.. Very helpful!<div><br></div><div>Seems silly that certain options in the .plist file are not automatically updated. I will file a bug report as this is not good.</div><div><br>
</div><div>One quick question that I think I know the answer to.. You said "Since command-line options override the config file options in dnsmasq (as with most other utilities), your config file is ignored in preference of the .plist/command line option."</div>
<div><br></div><div>I understand that options that are listed in the .plist will override the config file. But do the rest of the config file options still work correctly? </div><div><br></div><div>I assume they do, as I said in my original post that it sees my alternate hosts file, even though it is only listed in the config.</div>
<div><br></div><div>Thanks again,</div><div>JP</div><div><br></div><div><br><br><div class="gmail_quote">On Tue, Aug 3, 2010 at 2:49 PM, Perette Barella <span dir="ltr"><<a href="mailto:perette@barella.org">perette@barella.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">The .plist file is a Mac-only thing. As such, it is not part of the "standard" dnsmasq distribution, but something that MacPorts adds.<br>
<br>
For reference, the full contents of the file are:<br>
<?xml version='1.0' encoding='UTF-8'?><br>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"<br>
"<a href="http://www.apple.com/DTDs/PropertyList-1.0.dtd" target="_blank">http://www.apple.com/DTDs/PropertyList-1.0.dtd</a>"><br>
<plist version='1.0'><br>
<dict><br>
<key>Label</key><br>
<string>org.macports.dnsmasq</string><br>
<key>ProgramArguments</key><br>
<array><br>
<string>/opt/local/sbin/dnsmasq</string><br>
<string>-k</string><br>
<string>-r</string><br>
<string>/etc/resolv.conf</string><br>
</array><br>
<key>KeepAlive</key><br>
<dict><br>
<key>NetworkState</key><br>
<true/><br>
</dict><br>
</dict><br>
</plist><br>
<br>
This file is statically installed this way as part of the MacPorts dnsmasq package, and no, it isn't updated programatically. This XML file is used by launchd(8) on OS X to know when and how to launch dnsmasq during boot. (For other UNIX folks, launchd(8) is the replacement for init(8) and inetd(8)). This is resulting in dnsmasq being invoked with a command line of:<br>
/opt/local/sbin/dnsmasq/dnsmasq -k -r /etc/resolv.conf<br>
Since command-line options override the config file options in dnsmasq (as with most other utilities), your config file is ignored in preference of the .plist/command line option. So it's MacPorts fault. Why the MacPorts people decided that "-r /etc/resolv.conf" should be specified on the command line, I don't know, but it seems like a poor choice to me; you can just remove the lines corresponding to "-r" and "/etc/resolv.conf" and then it'll use your config file. Maybe you should log a bug report with MacPorts.<br>
<br>
-k is a reasonable command-line option for operating under launchd, which doesn't want processes to fork/exec. (It will by default try to spawn another instance of the process if/when it dies.) Don't remove that.<br>
<br>
Peri<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
On 2010年08月03日, at 17:14, John Puffs wrote:<br>
<br>
> I could NOT get it to work because my router constantly overwrites my resolv.conf file. So I set up dnsmasq.conf to read a separate file instead (resolv2.conf). Still did not work. I finally went into the dnsmasq.plist file and saw that /etc/resolv.conf was listed. I changed that and everything was fine.<br>
><br>
> I have since made other changes to dnsmasq.conf and do not see my dnsmasq.plist updating.<br>
><br>
> Is updating dnsmasq.conf supposed to re-write options to dnsmasq.plist?<br>
><br>
> Where does dnsmasq get it's options from; dnsmasq.conf, dnsmasq.plist or both??<br>
><br>
> I have dnsmasq.conf set to read /etc/hosts as well as a separate hosts file I use for blocking around 16,000 sites. Apparently this is working fine as it does block the sites and doing a dig shows it is going to 127.0.0.1 for any site. YET there is nothing in my plist to indicate that dnsmasq is supposed to read a separate hosts file. This makes me believe idnsmasq gets it's options from both dnsmasq.conf and dnsmasq.plist...<br>
><br>
> So I guess I have 2 questions:<br>
><br>
> 1. is updating dsnmasq.conf supposed to pass variables to dnsmasq.plist? If so I don't think mine is.. Why?<br>
> 2. What variables NEED to be in the .plist file as compared to the conf file?<br>
<br>
</div></div></blockquote></div><br></div>