<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <tt>Newer Ubuntu systems use systemd-resolved which doesn't seem to
      support split-horizon dns (at least last time I looked).<br>
      <br>
      One solution is to go back to using dnsmasq.<br>
      <br>
      * Install dnsmasq:<br>
    </tt>
    <pre><tt>apt get install dnsmasq</tt></pre>
    <tt><br>
      * Update </tt><tt><tt>/etc/NetworkManager/NetworkManager.conf</tt><tt>:<br>
      </tt></tt>
    <pre><tt><tt>[main]</tt></tt></pre>
    <pre><tt><tt>...</tt></tt></pre>
    <pre><tt>dns=dnsmasq</tt></pre>
    <tt><br>
    </tt><tt>* Add a dnsmasq config file to /etc/NetworkManager/</tt><tt><code>dnsmasq.d/foo.conf
        with your servers:</code></tt><br>
    <tt><code><tt><code><code>server=/foo.bar/bar.baz/1.2.3.4<br>
              <br>
              * Restart network manager:<br>
            </code></code></tt></code></tt>
    <pre><tt><code><tt><code><code>sudo service network-manager restart</code></code></tt></code></tt></pre>
    <pre><tt><code><tt><code><code></code></code></tt></code></tt></pre>
    <tt><code><code><br>
          * You might have to stop and disable the dnsmasq and resolved
          units:</code></code></tt><br>
    <pre>sudo systemctl stop systemd-resolved dnsmasq
sudo systemctl disable systemd-resolved dnsmasq</pre>
    <tt><code><code><br>
          * You might also have to link /etc/resolv.conf to the network
          manager generated one</code></code></tt>:<br>
    <pre>sudo mv /etc/resolv.conf /etc/resolv.conf.orig
sudo ln -s /run/NetworkManager/resolv.conf /etc/resolv.conf</pre>
    <tt><code><code><br>
          -Dennis<br>
        </code><br>
        <br>
      </code></tt>
    <div class="moz-cite-prefix">On 1/8/20 2:37 PM, Ken D'Ambrosio
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:e883e46106968c0f6cfec28719579804@jots.org">
      <pre class="moz-quote-pre" wrap="">Hey, all.  When I fire up my VPN, it re-writes my /etc/resolv.conf.  
Shocker.  But I *want* it to, because then all my DNS stuff is good for 
my company.  But it's NOT good for my personal domain.  I'd like to have 
that added to the search domains.  I'm in Ubuntu; not sure if that 
matters.  From my reading:
* I can the search domains on a per-interface manner, but that seems 
hokey, and subject to issues if I use something (e.g., Bluetooth) to be 
my conduit to the 'Net.
* /etc/resolv.conf shouldn't be manually modified as it'll just get 
overwritten (and I don't want to make it immutable because I want it to 
change depending on whether I'm using VPN or no)
* /etc/dhclient/dhclient.conf (apparently) doesn't matter any more if 
you're running NetworkManager

So, my question: is there an elegant, global way to set/append to my DNS 
domain search list?  Or am I just gonna wind up writing a daemon to wham 
an resolv.conf in-place depending on the current network config?

Thanks,

-Ken
_______________________________________________
gnhlug-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gnhlug-discuss@mail.gnhlug.org">gnhlug-discuss@mail.gnhlug.org</a>
<a class="moz-txt-link-freetext" href="http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/">http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>