<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 05/14/2015 10:20 AM, Maciej Soltysiak wrote:<br>
    <blockquote
cite="mid:CAMZR1YAEKB+cWXGOX=GBua5TfA4=A_T0nqreVKGVvPS88mvxDQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Terry,
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Thu, May 14, 2015 at 3:34 PM,
            Terry Carmen <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:terry@bupkis.org" target="_blank">terry@bupkis.org</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">I'm running dnsmasq
              with a large hosts file that contains entries like:<br>
              <br>
              127.0.0.1 <a moz-do-not-send="true"
                href="http://001.adsenser.cn" target="_blank">001.adsenser.cn</a><br>
              <br>
              Is there a way to get dnsmasq to return NXDOMAIN instead
              of 127.0.0.1 for these entries?<br>
            </blockquote>
            <div>Absolutely! I also believe that is a far better
              solution to return NXDOMAIN.<br>
              <br>
            </div>
            <div>Simon responded to a similar question of mine a while
              ago [1]<br>
              <br>
            </div>
            <div>Basically you add:<br>
              server=/<a moz-do-not-send="true"
                href="http://double-click.net/">double-click.net/</a><br>
              <br>
            </div>
            <div>You can have multiple domains in one line, remember to
              end with a /<br>
            </div>
            <div>server=/<a moz-do-not-send="true"
                href="http://double-click.net/other.evil.domain/">double-click.net/other.evil.domain/</a><br>
            </div>
            <div><br>
            </div>
            <div>Remember to remove the entries from hosts afterwards.<br>
            </div>
            <div>Also, I'm not sure if this is a limitation in dnsmasq
              or somewhere else, but I had a situation where a 'server'
              line was too long and I had to split it up. I don't have
              that many domains I filter out. Mostly biggest trackers
              and place my SmartTV calls.<br>
            </div>
            <div><br>
              [1] <a moz-do-not-send="true"
href="http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q3/007512.html">http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q3/007512.html</a><br>
            </div>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Thanks for the quick response!<br>
    <br>
    I saw your original message, but it seems to be targeted for a
    config file in /etc/dnsmasq.d/, not a hosts file.<br>
    <br>
    Right now my list format is in "hosts" file format of "127.0.0.1
    <a class="moz-txt-link-abbreviated" href="http://www.baddomain.com">www.baddomain.com</a>"<br>
    <br>
    I could reformat the file, but was wondering if there was something
    I could substitute for the 127.0.0.1 so dnsmasq would return
    NXDOMAIN?<br>
    <br>
    Thanks!<br>
    <br>
    Terry<br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
  </body>
</html>