<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I would suggest using some prefix for internal names anyway. I
      tend to use something like in.example.net for internal (private)
      networks, where example.net contains only public records. Such
      config can work with DNSSEC for example and makes it easier to
      debug what is defined on which network.</p>
    <p>I think dnsmasq acting as local server should override all names
      defined locally, so it should work like you have described. Even
      for dynamically connected hosts using DHCP. If it defines names in
      dnsmasq, it answers instead of forwarding. Just ensure you define
      local=/somedomain.com/ to prevent forwarding queries to your zone,
      which is not defined inside your zone. auth-zone=somedomain.com
      should also work. That forwards all names undefined names, except
      it generates NXDOMAIN responses for names in the domain it does
      not define.</p>
    <p>Hope that helps. Your description is kind of hard to understand,
      more detailed examples might help. Of course what you have tried
      already and what works and what does not would help much more.</p>
    <p>Cheers,<br>
      Petr<br>
    </p>
    <div class="moz-cite-prefix">On 12/13/23 17:28, Michel DIEMER via
      Dnsmasq-discuss wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:242585485.8619445.1702484883613@wlpnf0201.sys.meshcore.net">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div
style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#00000">‌</div>
      <div
style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#00000">‌</div>
      <div
style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#00000">‌</div>
      <div
style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#00000">‌<span
          style="color:rgb(0, 0, 0)">Dear dnsmasq user,</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">I have a domain let's
          claim that it is somedomain.com</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">I own that domain and it is
          officially registred and the name servers for that domain are
          on the Internet.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">There is a physical server with
          two network interfaces, one connected to the Internet and one
          connected to the local network.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">dnsmasq is running on that
          server.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">My ISP does not support IPv6.
          IPv6 is not disabled but not properly configured. IPv4
          is configured.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">The web ports (80 and 443) are
          redirected to the web server of the local network. Only the
          server with dnsmasq and the web server are accessible from the
          Internet. Other computers are not and should not.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">So when I type "https://</span><span
style="border:0px; color:rgb(51, 51, 51); font-family:helvetica neue,helvetica,arial,sans-serif; font-feature-settings:normal; font-kerning:auto; font-optical-sizing:auto; font-stretch:normal; font-variant-alternates:normal; font-variant-east-asian:normal; font-variant-numeric:normal; font-variant-position:normal; font-variation-settings:normal; line-height:normal; margin:auto; padding:0px">somedomain.com"
          from any web browser, from the local network or from the
          Internet, the website is loaded from the internet server on
          the local network.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">Now I have several computers on
          the local network and dnsmasq is configured for the domain
          "somedomain.com".</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">The domain of the localnetwork
          is "somedomain.com".</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">Now when I ping a computer on
          the Interneet from the local network it is working fine, using
          some publc DNS.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">The problem is when I want to
          "ping somecomputer.somedimain.com".</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">If "somecomputer" is on the lan
          I want dnsmasq to give the private, local IP address.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">If "somecomputer" is not on the
          lan, dnsmasq may use the public name server as anyone who is
          on the Internet.</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span
style="border:0px; color:rgb(51, 51, 51); font-family:helvetica neue,helvetica,arial,sans-serif; font-feature-settings:normal; font-kerning:auto; font-optical-sizing:auto; font-stretch:normal; font-variant-alternates:normal; font-variant-east-asian:normal; font-variant-numeric:normal; font-variant-position:normal; font-variation-settings:normal; line-height:normal; margin:auto; padding:0px">"ping
          computer1.somedomain.com" -> local IP address, fine<br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; line-height: normal; margin: auto; padding: 0px;">
          <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; line-height: normal; margin: auto; padding: 0px;">
          "ping computer2.somedomain.com" -> tries to find computer2
          on the WAN using the public IPv4 address. Not working. dnsmasq
          should find computer2.<br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; line-height: normal; margin: auto; padding: 0px;">
          <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; line-height: normal; margin: auto; padding: 0px;">
          "ping somedomain.com" -> should return either the public
          Internet IP address of the domain or the local IP address of
          the local dns server. Works fine from Internet but not from
          the internal network.<br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; line-height: normal; margin: auto; padding: 0px;">
          <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; line-height: normal; margin: auto; padding: 0px;">
          "ping google.fr" -> works find, using public DNS</span><br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <br
style="font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: auto; padding: 0px; color: rgb(0, 0, 0);">
        <span style="color:rgb(0, 0, 0)">If it is not supposed to work I
          will replace dnsmasq setting from domain=somedomain.com
          to domain=lan.</span><span
style="border:0px; color:rgb(51, 51, 51); font-family:helvetica neue,helvetica,arial,sans-serif; font-feature-settings:normal; font-kerning:auto; font-optical-sizing:auto; font-stretch:normal; font-variant-alternates:normal; font-variant-east-asian:normal; font-variant-numeric:normal; font-variant-position:normal; font-variation-settings:normal; line-height:normal; margin:auto; padding:0px">somedomain.com
          or domain=somedomain.lan. Except the web server, other
          computers on the local network are not supposed to be visible
          from the Internet.</span></div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Dnsmasq-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.thekelleys.org.uk</a>
<a class="moz-txt-link-freetext" href="https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss">https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Petr Menšík
Software Engineer, RHEL
Red Hat, <a class="moz-txt-link-freetext" href="https://www.redhat.com/">https://www.redhat.com/</a>
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB</pre>
  </body>
</html>