<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Did you know that dnsmasq registers all hosts by their name, if
      they send their own hostname when requesting DHCP from dnsmasq?
      Just use domain=mylab and have that host send hostname. It would
      make using names possible without any additional configuration.<br>
    </p>
    <p>I do not get what is the advantage of having IP suffixed by some
      domain. It looks like IP address, but it is even longer. Names of
      machines should be easy to remember or use, I doubt that would be
      the case here.</p>
    <p>I think we have new feature conf-script, which can generate
      dnsmasq configuration on the output. But I doubt we have a
      possible code for what you describe. Could you please describe
      more about intended usage? Why isn't using just hostname for each
      host enough? Using dhcp-host seems enough for similar uses.<br>
    </p>
    <p>I think DLZ plugins for BIND9 are able to do similar things to
      your request, but that would be very heavy-weight solution. I
      think more motivation for your current design should be shared,
      because I do not understand advantage of your solution.</p>
    <p>Cheers,<br>
      Petr<br>
    </p>
    <div class="moz-cite-prefix">On 11/23/22 06:47, Feng Shao wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJGJRzR5E9P6YxhT6aLGdP7oYGORGRDZNib6wh-JxXCKPjQh5w@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <span style="color:rgb(49,49,49);word-spacing:1px">There are a
        bunch of machines in our lab, and we normally don't have DNS
        records configured for them, only accessing by IP. In order to
        ssh to them with key auth, I have a config in my .ssh/config
        like </span><br style="color:rgb(49,49,49);word-spacing:1px">
      <br style="color:rgb(49,49,49);word-spacing:1px">
      <span style="color:rgb(49,49,49);word-spacing:1px">Host *.mylab</span><br
        style="color:rgb(49,49,49);word-spacing:1px">
      <span style="color:rgb(49,49,49);word-spacing:1px">  User root</span><br
        style="color:rgb(49,49,49);word-spacing:1px">
      <span style="color:rgb(49,49,49);word-spacing:1px">  IdentityFile
        ~/.ssh/</span><a href="http://id_rsa.work/" target="_blank"
        style="font-size:1rem;word-spacing:1px" moz-do-not-send="true">id_rsa.work</a><br
        style="color:rgb(49,49,49);word-spacing:1px">
      <br style="color:rgb(49,49,49);word-spacing:1px">
      <span style="color:rgb(49,49,49);word-spacing:1px">and I have some
        "address=/<a href="http://123.123.123.123"
          moz-do-not-send="true">123.123.123.123</a>.</span><span
        style="color:rgb(49,49,49);word-spacing:1px">mylab/</span><a
        href="http://123.123.123.123/" target="_blank"
        style="font-size:1rem;word-spacing:1px" moz-do-not-send="true">123.123.123.123</a><span
        style="color:rgb(49,49,49);word-spacing:1px">" line in
        dnsmasq.conf. The problem here is I need to add an entry
        whenever a new IP comes.</span><br
        style="color:rgb(49,49,49);word-spacing:1px">
      <br style="color:rgb(49,49,49);word-spacing:1px">
      <span style="color:rgb(49,49,49);word-spacing:1px">Can this
        configuration be dynamically? For example,
        "address=/*.mylab/somecmd %1", where "somecmd" is a external
        command and %1 will be replaced by the name in A/AAAA request.
        So that for any DNS request to *.mylab, dnsmasq invoke this
        external command and pass the name as argument, the output of
        external command, which will be interpreted as IPv4/IPv6 addr
        then responsed to client?</span>
      <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>