• Address 127.0.1.1

    From Paul M Foster@21:1/5 to All on Fri May 24 14:10:01 2024
    Folks:

    In my /etc/hosts file, there's a line:

    127.0.1.1 yosemite.mars.lan yosemite

    I think Debian put it there.

    Later in the file, I've got:

    192.168.254.30 yosemite.mars.lan yosemite

    So there are two entries for the same (my) machine. Is this a problem? Specifically, could it cause problems with email (Exim4 or OpenSMTPD)?

    Paul

    --
    Paul M. Foster
    Personal Blog: http://noferblatz.com
    Company Site: http://quillandmouse.com
    Software Projects: https://gitlab.com/paulmfoster

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Paul M Foster on Fri May 24 14:20:01 2024
    On Fri, May 24, 2024 at 08:05:43AM -0400, Paul M Foster wrote:
    Folks:

    In my /etc/hosts file, there's a line:

    127.0.1.1 yosemite.mars.lan yosemite

    I think Debian put it there.

    Correct. This is the address that will be used if you don't have a
    static LAN address.

    Later in the file, I've got:

    192.168.254.30 yosemite.mars.lan yosemite

    Since you *do* have a static LAN address, you can use this one instead. (Assuming this address actually *does* get assigned to an interface.)
    The 127.0.1.1 address isn't needed in this case.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Ritter@21:1/5 to Paul M Foster on Fri May 24 14:40:01 2024
    Paul M Foster wrote:
    Folks:

    In my /etc/hosts file, there's a line:

    127.0.1.1 yosemite.mars.lan yosemite

    I think Debian put it there.

    Later in the file, I've got:

    192.168.254.30 yosemite.mars.lan yosemite

    So there are two entries for the same (my) machine. Is this a problem? Specifically, could it cause problems with email (Exim4 or OpenSMTPD)?

    Technically possible, but unlikely. If you had exim or opensmtpd
    configured to only bind to the 192.168 address, and not the
    localhost address, then you might manage to run into an issue.

    As long as the 192.168 address is correct, you can replace
    127.0.1.1 to refer to 'localhost' alone.

    -dsr-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Fri May 24 16:50:01 2024
    Am 24.05.2024 um 08:05:43 Uhr schrieb Paul M Foster:

    In my /etc/hosts file, there's a line:

    127.0.1.1 yosemite.mars.lan yosemite

    I think Debian put it there.

    Should be there so the hostname is resolvable - even when not in DNS.

    Later in the file, I've got:

    192.168.254.30 yosemite.mars.lan yosemite

    Check which program put that in here. I don't see a reason to have that
    here.

    So there are two entries for the same (my) machine. Is this a problem? Specifically, could it cause problems with email (Exim4 or OpenSMTPD)?

    If you operate mail servers, you must have a FQDN. .lan can't be used
    for the global DNS stuff, so set a proper FQDN that belongs to you.


    --
    Gruß
    Marco

    Send unsolicited bulk mail to [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Marco Moock on Fri May 24 17:30:01 2024
    On Fri, May 24, 2024 at 05:22:14PM +0200, Marco Moock wrote:
    Am 24.05.2024 um 17:17:45 Uhr schrieb [email protected]:

    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be
    used for the global DNS stuff, so set a proper FQDN that belongs to
    you.

    I think this is wrong in that sweeping generality.

    In the case it should communicate with other MTAs in the internet, this
    will be true because many of them require a resolvable (also reverse)
    FQDN in HELO/EHLO that matches the IPv4/IPv6 addresses of the server.

    Definitely.

    But then it'd another interface which isn't 127.0.0.1 or the 192.168.x.y

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZlCyOQAKCRAFyCz1etHa Rq3gAJ9+ZvJhqXV5jauKpzt4fIK8MCd1JwCeL+XNXrOUXILnGS1DobVToTGrJu4=
    =+avg
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Fri May 24 17:30:01 2024
    Am 24.05.2024 um 17:17:45 Uhr schrieb [email protected]:

    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be
    used for the global DNS stuff, so set a proper FQDN that belongs to
    you.

    I think this is wrong in that sweeping generality.

    In the case it should communicate with other MTAs in the internet, this
    will be true because many of them require a resolvable (also reverse)
    FQDN in HELO/EHLO that matches the IPv4/IPv6 addresses of the server.


    --
    Gruß
    Marco

    Send unsolicited bulk mail to [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Marco Moock on Fri May 24 17:20:01 2024
    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be used
    for the global DNS stuff, so set a proper FQDN that belongs to you.

    I think this is wrong in that sweeping generality.

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZlCvmQAKCRAFyCz1etHa RtNfAJwKj2OUuUqAmPzQA3bdcbxT3rB1TQCfTK+FVgsoGlpjXQK9W/erwxhcO1E=
    =5kwZ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Marco Moock on Fri May 24 17:50:01 2024
    On Fri, May 24, 2024 at 05:22:14PM +0200, Marco Moock wrote:
    Am 24.05.2024 um 17:17:45 Uhr schrieb [email protected]:

    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be
    used for the global DNS stuff, so set a proper FQDN that belongs to
    you.

    I think this is wrong in that sweeping generality.

    In the case it should communicate with other MTAs in the internet, this
    will be true because many of them require a resolvable (also reverse)
    FQDN in HELO/EHLO that matches the IPv4/IPv6 addresses of the server.

    Most MTAs do not look in /etc/hosts when reading their configuration.
    Whatever name they identify with (in the HELO or EHLO command) comes
    from some MTA-specific configuration file.

    Thus, the contents of /etc/hosts are for *other* things, not related to
    MTA configuration. Just being able to resolve your own hostname to any
    address that "works" is the goal. 127.0.1.1 works well for this, which
    is why Debian uses it as the default. If you've got a static LAN address,
    you can use that instead.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul M Foster@21:1/5 to Greg Wooledge on Fri May 24 18:20:01 2024
    On Fri, May 24, 2024 at 11:40:30AM -0400, Greg Wooledge wrote:

    On Fri, May 24, 2024 at 05:22:14PM +0200, Marco Moock wrote:
    Am 24.05.2024 um 17:17:45 Uhr schrieb [email protected]:

    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be
    used for the global DNS stuff, so set a proper FQDN that belongs to you.

    I think this is wrong in that sweeping generality.

    In the case it should communicate with other MTAs in the internet, this will be true because many of them require a resolvable (also reverse)
    FQDN in HELO/EHLO that matches the IPv4/IPv6 addresses of the server.

    Most MTAs do not look in /etc/hosts when reading their configuration. Whatever name they identify with (in the HELO or EHLO command) comes
    from some MTA-specific configuration file.

    Thus, the contents of /etc/hosts are for *other* things, not related to
    MTA configuration. Just being able to resolve your own hostname to any address that "works" is the goal. 127.0.1.1 works well for this, which
    is why Debian uses it as the default. If you've got a static LAN address, you can use that instead.

    I should note that this is apparently not true for OpenSMTPD. In fact,
    there is or was a bug in it, such that if you had two instances of
    127.0.0.1 in your hosts file, OpenSMTPD would fail with a message that it couldn't listen on address 127.0.0.1 because it was already in use (or somesuch).

    Paul

    --
    Paul M. Foster
    Personal Blog: http://noferblatz.com
    Company Site: http://quillandmouse.com
    Software Projects: https://gitlab.com/paulmfoster

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joe@21:1/5 to [email protected] on Fri May 24 18:50:01 2024
    On Fri, 24 May 2024 17:17:45 +0200
    <[email protected]> wrote:

    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be
    used for the global DNS stuff, so set a proper FQDN that belongs to
    you.

    I think this is wrong in that sweeping generality.


    I believe the dynamic DNS services will supply an FQDN if you don't
    have one, it just won't be personal, it will be one of theirs. But
    trying to run a mail server on a dynamic address leads to all kinds of blacklist problems.

    --
    Joe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joe@21:1/5 to Greg Wooledge on Fri May 24 18:50:01 2024
    On Fri, 24 May 2024 11:40:30 -0400
    Greg Wooledge <[email protected]> wrote:

    On Fri, May 24, 2024 at 05:22:14PM +0200, Marco Moock wrote:
    Am 24.05.2024 um 17:17:45 Uhr schrieb [email protected]:

    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be
    used for the global DNS stuff, so set a proper FQDN that
    belongs to you.

    I think this is wrong in that sweeping generality.

    In the case it should communicate with other MTAs in the internet,
    this will be true because many of them require a resolvable (also
    reverse) FQDN in HELO/EHLO that matches the IPv4/IPv6 addresses of
    the server.

    Most MTAs do not look in /etc/hosts when reading their configuration. Whatever name they identify with (in the HELO or EHLO command) comes
    from some MTA-specific configuration file.

    Thus, the contents of /etc/hosts are for *other* things, not related
    to MTA configuration. Just being able to resolve your own hostname
    to any address that "works" is the goal. 127.0.1.1 works well for
    this, which is why Debian uses it as the default. If you've got a
    static LAN address, you can use that instead.


    Long ago, lo used to be just 127.0.0.1, which is what most people would
    try to ping to check localhost, and what appeared in /etc/hosts. There
    is some subtle reason, which I used to know but have now long forgotten,
    why Debian started using 127.0.1.1 in /etc/hosts instead. As far as I'm
    aware, any 127. address will resolve to localhost.

    --
    Joe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul M Foster@21:1/5 to Joe on Fri May 24 19:20:01 2024
    On Fri, May 24, 2024 at 05:22:13PM +0100, Joe wrote:

    On Fri, 24 May 2024 11:40:30 -0400
    Greg Wooledge <[email protected]> wrote:

    On Fri, May 24, 2024 at 05:22:14PM +0200, Marco Moock wrote:
    Am 24.05.2024 um 17:17:45 Uhr schrieb [email protected]:

    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be
    used for the global DNS stuff, so set a proper FQDN that
    belongs to you.

    I think this is wrong in that sweeping generality.

    In the case it should communicate with other MTAs in the internet,
    this will be true because many of them require a resolvable (also reverse) FQDN in HELO/EHLO that matches the IPv4/IPv6 addresses of
    the server.

    Most MTAs do not look in /etc/hosts when reading their configuration. Whatever name they identify with (in the HELO or EHLO command) comes
    from some MTA-specific configuration file.

    Thus, the contents of /etc/hosts are for *other* things, not related
    to MTA configuration. Just being able to resolve your own hostname
    to any address that "works" is the goal. 127.0.1.1 works well for
    this, which is why Debian uses it as the default. If you've got a
    static LAN address, you can use that instead.


    Long ago, lo used to be just 127.0.0.1, which is what most people would
    try to ping to check localhost, and what appeared in /etc/hosts. There
    is some subtle reason, which I used to know but have now long forgotten,
    why Debian started using 127.0.1.1 in /etc/hosts instead. As far as I'm aware, any 127. address will resolve to localhost.


    My understanding is that 127.0.1.1 is used for hostnames defined by the
    user on setup. In setup, you don't specify an IP for your box, so the
    hostname goes in the 127.0.1.1. Later, the user can edit the hosts file to specify a fixed IP if he has one.

    Paul

    --
    Paul M. Foster
    Personal Blog: http://noferblatz.com
    Company Site: http://quillandmouse.com
    Software Projects: https://gitlab.com/paulmfoster

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Joe on Fri May 24 19:20:02 2024
    On Fri, May 24, 2024 at 05:23:55PM +0100, Joe wrote:
    On Fri, 24 May 2024 17:17:45 +0200
    <[email protected]> wrote:

    On Fri, May 24, 2024 at 04:49:18PM +0200, Marco Moock wrote:

    [...]

    If you operate mail servers, you must have a FQDN. .lan can't be
    used for the global DNS stuff, so set a proper FQDN that belongs to
    you.

    I think this is wrong in that sweeping generality.


    I believe the dynamic DNS services will supply an FQDN if you don't
    have one, it just won't be personal, it will be one of theirs. But
    trying to run a mail server on a dynamic address leads to all kinds of blacklist problems.

    As far as I know we are talking of local networks all the time. No
    dynamic IP addresses, no routable IP addresses -- most probably no
    DNS at all.

    Of course, if you go "out there" things change drastically. More so
    if your MTA is supposed to accept mail from "out there" then it needs
    an MX record, yadda, yadda.

    But if I understood OP correctly, we are far from this scenario.

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZlDMBgAKCRAFyCz1etHa RhU0AJwLyOn07KXW3pN2UEa7ZQQlAptCQwCfbk3PhWm8wNf2wyOBmP1H3d7MAX0=
    =SUz6
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Jeffrey Walton on Fri May 24 19:50:01 2024
    On Fri, May 24, 2024 at 01:40:38PM -0400, Jeffrey Walton wrote:
    On Fri, May 24, 2024 at 11:13 AM Paul M Foster <[email protected]> wrote:
    192.168.254.30 yosemite.mars.lan yosemite

    127.0.1.1 is traditionally used for the fully qualified domain name
    (fqdn). So I would expect to see 'yosemite.mars.lan', but not
    'yosemite'.

    I don't know why you would expect that. What purpose would that serve?

    The goal here is for programs to be able to look up "the IP address"
    that belongs to $HOSTNAME.

    If the hostname is "yosemite", then "yosemite" must appear in the
    /etc/hosts file as an alias for whatever made-up FQDN is being used.

    This is what Paul has. What Paul has looks quite reasonable to me.
    If 192.168.254.30 is in fact bound to an ethernet interface by a
    static configuration (e.g. /etc/network/interfaces) then I would also
    say it looks correct.

    Also, fqdn's end in dot '.' to denote the top of the dns tree.

    Not in the /etc/hosts file, they don't. You may be thinking of BIND configuration files.

    I've never IN MY LIFE seen trailing dots on hostnames in /etc/hosts.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Joe on Fri May 24 19:40:02 2024
    On Fri, May 24, 2024 at 05:22:13PM +0100, Joe wrote:
    Long ago, lo used to be just 127.0.0.1, which is what most people would
    try to ping to check localhost, and what appeared in /etc/hosts. There
    is some subtle reason, which I used to know but have now long forgotten,
    why Debian started using 127.0.1.1 in /etc/hosts instead.

    It's not "instead". It's "in addition".

    hobbit:~$ head -n2 /etc/hosts
    127.0.0.1 localhost
    127.0.1.1 hobbit.wooledge.org hobbit

    The first line is traditional. Exactly what it looks like.

    The second line ensures that my hostname will always resolve to a
    working IP address. Lots of programs need that. Some of the most
    common reasons back in the old days were X clients that had been
    told to use "myhostname:0" as their $DISPLAY. If "myhostname" didn't
    resolve to a working IP address (one which could contact the X server),
    then X client programs wouldn't work.

    A lot has changed since then, but the basic principle remains the same.
    Some programs are going to expect to be able to open a network connection
    to whatever IP address the system's hostname resolves to. 127.0.1.1
    serves that purpose, without stepping on 127.0.0.1 which has its own
    legacy role to fulfill.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Wright@21:1/5 to Jeffrey Walton on Fri May 24 19:50:01 2024
    On Fri 24 May 2024 at 13:40:38 (-0400), Jeffrey Walton wrote:
    On Fri, May 24, 2024 at 11:13 AM Paul M Foster <[email protected]> wrote:

    Folks:

    In my /etc/hosts file, there's a line:

    127.0.1.1 yosemite.mars.lan yosemite

    I think Debian put it there.

    Later in the file, I've got:

    192.168.254.30 yosemite.mars.lan yosemite

    So there are two entries for the same (my) machine. Is this a problem? Specifically, could it cause problems with email (Exim4 or OpenSMTPD)?

    127.0.1.1 is traditionally used for the fully qualified domain name
    (fqdn). So I would expect to see 'yosemite.mars.lan', but not
    'yosemite'.

    Also, fqdn's end in dot '.' to denote the top of the dns tree. So I
    would expect to see 'yosemite.mars.lan.' (note the trailing dot), and
    not 'yosemite.mars.lan' (note the lack of the trailing dot). What can
    happen with 'yosemite.mars.lan' is, search domains can be added to it.
    So if dhcp says 'isp.com' is a search domain, then your network stack
    might make requests for 'yosemite.mars.lan.isp.com'.

    You must have a very unusual hosts file then, on both those counts.

    I would expect just the 127.0.1.1 line as written, and I'm going to
    guess that the 192.168.254.30 line was added as a misguided attempt
    to get LAN mail working. As noted by others, /etc/hosts is not the
    correct place for that.

    Cheers,
    David.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Jeffrey Walton on Fri May 24 20:30:01 2024
    On Fri, May 24, 2024 at 01:49:58PM -0400, Jeffrey Walton wrote:
    On Fri, May 24, 2024 at 1:46 PM Greg Wooledge <[email protected]> wrote:

    On Fri, May 24, 2024 at 01:40:38PM -0400, Jeffrey Walton wrote:
    On Fri, May 24, 2024 at 11:13 AM Paul M Foster <[email protected]> wrote:
    192.168.254.30 yosemite.mars.lan yosemite

    127.0.1.1 is traditionally used for the fully qualified domain name (fqdn). So I would expect to see 'yosemite.mars.lan', but not
    'yosemite'.

    I don't know why you would expect that. What purpose would that serve?

    Sorry I was not clear. I would expect that because 127.0.1.1 is
    traditionally used for a fully qualified domain name, not a hostname.

    What traditions are you referring to?

    Here's Debian's documentation for this whole thing:

    https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Greg Wooledge on Fri May 24 23:30:01 2024
    Greg Wooledge <[email protected]> wrote:
    On Fri, May 24, 2024 at 01:49:58PM -0400, Jeffrey Walton wrote:
    On Fri, May 24, 2024 at 1:46 PM Greg Wooledge <[email protected]>
    wrote:

    On Fri, May 24, 2024 at 01:40:38PM -0400, Jeffrey Walton wrote:
    On Fri, May 24, 2024 at 11:13 AM Paul M Foster <[email protected]> wrote:
    192.168.254.30 yosemite.mars.lan yosemite

    127.0.1.1 is traditionally used for the fully qualified domain
    name (fqdn). So I would expect to see 'yosemite.mars.lan', but
    not 'yosemite'.

    I don't know why you would expect that. What purpose would that
    serve?

    Sorry I was not clear. I would expect that because 127.0.1.1 is traditionally used for a fully qualified domain name, not a
    hostname.

    What traditions are you referring to?

    Here's Debian's documentation for this whole thing:

    https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution

    It's a Debian invention, I believe: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Chip Smith on Fri May 24 23:40:01 2024
    Hi,

    On Fri, May 24, 2024 at 11:55:54AM -0700, Chip Smith wrote:
    convention� as it pertains to the 127.0.0.1 iIP address is that it
    is meant to be used for testing purposes on a whole.

    I am quite sure that plenty of production traffic goes over
    localhost network connections on millions of servers worldwide.
    Think: reverse proxies (e.g. nginx) and backend app servers.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)