<div dir="ltr"><div dir="ltr" class="gmail_msg">thank you Arno, I'm with Manuel on the "IP address or hostname", maybe I didn't understand your previous explanation, but to me there's still a bigger issue/unclear behavior.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Let's say I just installed ubuntu on a machine with hostname server1 and ip 192.168.0.1 . In /etc/hosts I end up with two lines (per <a href="https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#s-net-dns" class="gmail_msg" target="_blank">https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#s-net-dns</a>):</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">127.0.0.1 localhost</div><div class="gmail_msg">127.0.1.1 server1 server1.domain (notice the two entries, with and without domain)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I then have bind configured on the network to resolve server1 to 192.168.0.1</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">If at this point I install NUT and set upsd.conf as a server and set the line such as:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">LISTEN server1.domain 3493</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I expect nut to listen on the local lan interface with ip 192.168.0.1 , ie I expect it to be equivalent to:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">LISTEN 192.168.0.1 3493</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">But it's not, the latter will listen on that ip while the former will listen on 127.0.0.1.</div><div class="gmail_msg"><br></div><div class="gmail_msg">If I want nut to only listen locally I would use 127.0.0.1 or localhost as in the examples on the nut's manual. This is my experience with configuring other daemons and how I'd expect nut to behave, again this doesn't mean it's right, just trying to explain where my problems are coming from.</div><div class="gmail_msg"><br></div><div class="gmail_msg">So, if we agree that that's how it's working and that the behavior is correct, the documentation should imho explicitly point that out that using the hostname is not sufficient to have nut listen on the external ip.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Does that make sense? If we agree on that then the statement "Bind a listening port to the interface specified by its Internet address or name" is incorrect or at least unintuitive because I'd think of server1 to refer to the lan interface, not lo.</div><div class="gmail_msg"><br></div><div class="gmail_msg">The other problem is that none of the fixes as far as I can see is particularly clean/straightforward:</div><div class="gmail_msg">- adding a second line with the domain does not help because of what's in /etc/hosts, so you still end up with NUT listening on localhost<br class="gmail_msg"></div><div class="gmail_msg">- using an ip is not possible if DHCP is in the mix or just inconvenient as it often is to hardcode ips in configs</div><div class="gmail_msg">- adding a line to /etc/hosts with the external ip would make it work, but again auto generating that from dhcp with a hook script isn't straightforward (not sure if there's a better way)</div><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg">what am I missing?</div><div class="gmail_msg"><br></div><div class="gmail_msg">thank you for your help,</div><div class="gmail_msg"><br></div><div class="gmail_msg">Spike</div><div class="gmail_msg"><br class="gmail_msg"></div></div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Wed, Mar 29, 2017 at 4:57 AM Manuel Wolfshant <<a href="mailto:wolfy@nobugconsulting.ro" class="gmail_msg" target="_blank">wolfy@nobugconsulting.ro</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
    <div class="m_5685453074420927417m_4503782839108287059moz-cite-prefix gmail_msg">On 03/29/2017 02:28 PM, Arnaud Quette
      wrote:<br class="gmail_msg">
    </div>
    <blockquote type="cite" class="gmail_msg">
      <div dir="ltr" class="gmail_msg"><br class="gmail_msg">
        <div class="gmail_extra gmail_msg"><br class="gmail_msg">
          <div class="gmail_quote gmail_msg">2017-03-29 12:32 GMT+02:00 Arnaud
            Quette <span dir="ltr" class="gmail_msg"><<a href="mailto:arnaud.quette@gmail.com" class="gmail_msg" target="_blank">arnaud.quette@gmail.com</a>></span>:<br class="gmail_msg">
            <blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote gmail_msg">
              <div dir="ltr" class="gmail_msg"><br class="gmail_msg">
                <div class="gmail_extra gmail_msg"><br class="gmail_msg">
                  <div class="gmail_quote gmail_msg">2017-03-29 5:49 GMT+02:00
                    Spike <span dir="ltr" class="gmail_msg"><<a href="mailto:spike@drba.org" class="gmail_msg" target="_blank">spike@drba.org</a>></span>:<span class="m_5685453074420927417m_4503782839108287059gmail- gmail_msg">
                      <div class="gmail_msg">(...)<br class="gmail_msg">
                      </div>
                    </span><span class="m_5685453074420927417m_4503782839108287059gmail- gmail_msg">
                      <blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                        <div dir="ltr" class="gmail_msg">
                          <div class="gmail_msg">Is this really the desired behavior? I
                            can certainly work with it, but it seems
                            it'd be nice if it could work with dns
                            resolution (at least client side, the LISTEN
                            statement I guess it's ok), but maybe I'm
                            missing some good reason why this would
                            cause other issues.</div>
                        </div>
                      </blockquote>
                    </span></div>
                  <br class="gmail_msg">
                </div>
                <div class="gmail_extra gmail_msg">this is indeed undocumented
                  (will fix it after this mail and a quick lunch), but
                  that works<br class="gmail_msg">
                </div>
              </div>
            </blockquote>
            <div class="gmail_msg"><br class="gmail_msg">
              I've clarified a bit:<br class="gmail_msg">
              <a href="https://github.com/networkupstools/nut/commit/e83780337183d5369f892891df08775198231fe0" class="gmail_msg" target="_blank">https://github.com/networkupstools/nut/commit/e83780337183d5369f892891df08775198231fe0</a><br class="gmail_msg">
              <br class="gmail_msg">
            </div>
            <div class="gmail_msg">I'm interested in some feedback on whether this
              clarifies enough or not...</div>
          </div>
        </div>
      </div>
    </blockquote></div><div bgcolor="#FFFFFF" text="#000000" class="gmail_msg">
    I'd use "IP address or hostname" rather than "IP address or name"<br class="gmail_msg">
  </div>

_______________________________________________<br class="gmail_msg">
Nut-upsuser mailing list<br class="gmail_msg">
<a href="mailto:Nut-upsuser@lists.alioth.debian.org" class="gmail_msg" target="_blank">Nut-upsuser@lists.alioth.debian.org</a><br class="gmail_msg">
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser</a></blockquote></div></div>