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 &quot;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.&quot;</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">&lt;<a href="mailto:perette@barella.org">perette@barella.org</a>&gt;</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 &quot;standard&quot; dnsmasq distribution, but something that MacPorts adds.<br>

<br>
For reference, the full contents of the file are:<br>
&lt;?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?&gt;<br>
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot;<br>
&quot;<a href="http://www.apple.com/DTDs/PropertyList-1.0.dtd" target="_blank">http://www.apple.com/DTDs/PropertyList-1.0.dtd</a>&quot;&gt;<br>
&lt;plist version=&#39;1.0&#39;&gt;<br>
  &lt;dict&gt;<br>
    &lt;key&gt;Label&lt;/key&gt;<br>
    &lt;string&gt;org.macports.dnsmasq&lt;/string&gt;<br>
    &lt;key&gt;ProgramArguments&lt;/key&gt;<br>
    &lt;array&gt;<br>
      &lt;string&gt;/opt/local/sbin/dnsmasq&lt;/string&gt;<br>
      &lt;string&gt;-k&lt;/string&gt;<br>
      &lt;string&gt;-r&lt;/string&gt;<br>
      &lt;string&gt;/etc/resolv.conf&lt;/string&gt;<br>
    &lt;/array&gt;<br>
    &lt;key&gt;KeepAlive&lt;/key&gt;<br>
    &lt;dict&gt;<br>
      &lt;key&gt;NetworkState&lt;/key&gt;<br>
      &lt;true/&gt;<br>
    &lt;/dict&gt;<br>
  &lt;/dict&gt;<br>
&lt;/plist&gt;<br>
<br>
This file is statically installed this way as part of the MacPorts dnsmasq package, and no, it isn&#39;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&#39;s MacPorts fault.  Why the MacPorts people decided that &quot;-r /etc/resolv.conf&quot; should be specified on the command line, I don&#39;t know, but it seems like a poor choice to me; you can just remove the lines corresponding to &quot;-r&quot; and &quot;/etc/resolv.conf&quot; and then it&#39;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&#39;t want processes to fork/exec.  (It will by default try to spawn another instance of the process if/when it dies.)  Don&#39;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>
&gt; 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>

&gt;<br>
&gt; I have since made other changes to dnsmasq.conf and do not see my dnsmasq.plist updating.<br>
&gt;<br>
&gt; Is updating dnsmasq.conf supposed to re-write options to dnsmasq.plist?<br>
&gt;<br>
&gt; Where does dnsmasq get it&#39;s options from; dnsmasq.conf, dnsmasq.plist or both??<br>
&gt;<br>
&gt; 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&#39;s options from both dnsmasq.conf and dnsmasq.plist...<br>

&gt;<br>
&gt; So I guess I have 2 questions:<br>
&gt;<br>
&gt; 1. is updating dsnmasq.conf supposed to pass variables to dnsmasq.plist? If so I don&#39;t think mine is.. Why?<br>
&gt; 2. What variables NEED to be in the .plist file as compared to the conf file?<br>
<br>
</div></div></blockquote></div><br></div>