From: Hartmut Goebel <h.goebel@goebel-consult.de>
To: guix-devel@gnu.org
Subject: Re: Contents of /etc/hosts
Date: Thu, 6 Oct 2016 12:07:37 +0200 [thread overview]
Message-ID: <57F62269.4090100@goebel-consult.de> (raw)
In-Reply-To: <20161006005710.GA2352@jocasta.intra>
[-- Attachment #1.1: Type: text/plain, Size: 2319 bytes --]
Am 06.10.2016 um 02:57 schrieb John Darrington:
> 127.0.0.1 localhost
> ::1 localhost
> 127.0.0.1 gambrinus
> ::1 gambrinus
>
> Or am I missing something?
>
> Hmm. I have never seen it done this way elsewhere, and I really wonder how some
> services will react if they discover that 127.0.0.1 is not called "localhost"?
> Or that one address is known by two names. I think it possible they might
> assume a security breach and refuse to work.
This should not be a problem. One could always add several entries for
the same IP-address. And "getent hosts 127.0.0.1" will return the first
entry in /etc/hosts AFAIKT.
I started digging through the man pages, but did not finish. It's a deep
maybe recursive mess of documentation where nothing is said about Maybe
we need to refer to the gethostbyname(2) and gethostbyname(3)
documentation, which both are listed in "man hostname".
* gethostbyname(2) [1], uses uname[2], which returns what ever has been
set with sethostname (AFAICT) and always returns a single string.
* gethostbyname(3) [3] returns a structure capable to hold an name,
several aliases, and several addresses.
Nevertheless my conclusion is that any program should be able to handle
any ip-address and and hostname and must not rely on any assumtion
regarding these. (Exept perhaps to assume "localhost" is defined.)
[1] http://man7.org/linux/man-pages/man2/gethostname.2.html
[2] http://man7.org/linux/man-pages/man2/uname.2.html
[3] http://man7.org/linux/man-pages/man3/gethostbyname.3.html
[4] http://man7.org/linux/man-pages/man5/hosts.5.html
> Kerberos is very fussy about such things.
Yes, it is, forward and backward resolution must match. But this can be
done with a the hostname's non-loopback IP-address being in front of the
loopback entry. ASAIK
--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software
Development
Goebel Consult, Landshut
http://www.goebel-consult.de
Blog: http://www.goebel-consult.de/blog/feiertagsarbeit-bei-teletrust
Kolumne:
http://www.cissp-gefluester.de/2011-02-fleisige-datensammler-fur-lukratives-geschaeftsmodell-gesucht
[-- Attachment #1.2: Type: text/html, Size: 4171 bytes --]
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 2430 bytes --]
next prev parent reply other threads:[~2016-10-06 10:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 18:31 Contents of /etc/hosts John Darrington
2016-10-05 20:17 ` Ludovic Courtès
2016-10-06 0:57 ` John Darrington
2016-10-06 10:07 ` Hartmut Goebel [this message]
2016-10-08 14:19 ` John Darrington
2016-10-11 20:25 ` Ludovic Courtès
2016-10-06 9:24 ` Hartmut Goebel
2016-10-08 14:08 ` John Darrington
2016-10-09 9:12 ` Hartmut Goebel
2016-10-09 9:56 ` John Darrington
2016-10-09 10:53 ` Hartmut Goebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57F62269.4090100@goebel-consult.de \
--to=h.goebel@goebel-consult.de \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.