Re: where is /etc/hosts supposed to come from?
Hi, On Fri, Jan 01, 2010 at 10:29:51AM +1100, Brian May wrote: On Thu, Dec 31, 2009 at 04:33:44PM +, Philipp Kern wrote: Using .local in own environments sadly clashes with the (I think now installed by default) mDNS namespace for locally-resolvable hostnames. But it somehow makes sense for a laptop; it would even resolve. ;-) Yes, that is what I was getting at too. It is also a problem for Mac OS X boxes, at least without fiddling. I was naively thinking if hostname part being unique, it does not clash. Am I incorrect? This can be a problem even if you don't intend to use zeroconf/mdns on your network. Typically what happens is DNS queries time out without resolving and packet traces show that there are no requests happening. I see this. But this is general problem whatever bogus domain name is used including ones like .invalid or .pri. I don't know of any good choice for a TLD that is guaranteed not to be used on the Internet, although currently I am using .pri (short for .private) here. I see your point. It is less likely to crash since very few people have chosen .pri than .local. But this doesn not seem to be something as a widely accepted gneral practice as you described. Even .local is only mentioned in a experimental RFC that had expired (at least last I checked which was a while ago now). In case any is confused of the relationship between mdns and zeroconf: ... of the GNU C Library (glibc) providing host name resolution via Multicast DNS (using Zeroconf, aka Apple Bonjour / Apple Rendezvous ), effectively allowing name resolution by common Unix/Linux programs in the ad-hoc mDNS domain .local. I thought FQDN under such environment is hostname.local . (Chosing overlapping hostname itself on a single LAN is not good idea and very rare.) It seems these is no agreed practice to minimize negative impact. But there are many good-enough solutions used widely by picking bogus domain like .pri .lan .??? Osamu -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Vincent, On Fri, Jan 01, 2010 at 09:53:30PM +0100, Vincent Lefevre wrote: On 2009-12-31 14:34:34 -0800, Russ Allbery wrote: Uh, no. That statement implies nothing of the sort; identification is not necessarily unique. I suggest that you look in a dictionary. Russ already said he was not going to further participate in this discussion, so trying to drag him back by using indirect insults is not something I personally find very appropriate for this list. Michael -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Sat, Jan 02, 2010 at 10:06:01PM +0900, Osamu Aoki wrote: Hi, On Fri, Jan 01, 2010 at 10:29:51AM +1100, Brian May wrote: On Thu, Dec 31, 2009 at 04:33:44PM +, Philipp Kern wrote: Using .local in own environments sadly clashes with the (I think now I see ... servicing LAN with DNS server serving .local domain causes problem with mDNS set-up. Anyway, it was interesting to find out that popular .local usage and leaky DNS quesry for it to the Internet was so much annoiance these days. http://stats.l.root-servers.org/cgi-bin/dsc-grapher.pl?window=86400plot=qtype_vs_all_tldserver=L-root It seems `local`, `lan`, `home`, `invalid`, `localdomain`, `none`, and `private` seems to be popular bogus one TLS to use. Osamu -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
* Philipp Kern: That's false. You can use protocol-level gateways, which do NAT and PT (protocol translation). Can you point me to one please? There's DNS64 and BEHAVE, probably with some free implementation. Of course, there are hardly any users because the entire IPv6 user base is rather small, and we're talking about a renegade faction of that. IOS has NAT-PT support, IIRC. It's also patent-encumbered. -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2010-01-01, Florian Weimer f...@deneb.enyo.de wrote: * Philipp Kern: That's false. You can use protocol-level gateways, which do NAT and PT (protocol translation). Can you point me to one please? There's DNS64 and BEHAVE, probably with some free implementation. Of course, there are hardly any users because the entire IPv6 user base is rather small, and we're talking about a renegade faction of that. I wouldn't call them renegade, to be honest. I wondered back then how to achieve an IPv6-only network to check applications for compatibility, but missed the option to still connect to IPv4 hosts without the use of proxies. I don't care about the additional NAT layer because I'm NATed anyway. Thanks for those pointers, although the implementations seem to be missing (not for Windows but for others as it seems). IOS has NAT-PT support, IIRC. It's also patent-encumbered. Oh ok, I just saw documents deprecating NAT-PT altogether, but I didn't know the latter. Thanks a lot, Philipp Kern -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-31 14:34:34 -0800, Russ Allbery wrote: Uh, no. That statement implies nothing of the sort; identification is not necessarily unique. I suggest that you look in a dictionary. I've been participating in standardization of network protocols through the IETF for more than a decade now, and I've never seen someone use this definition of FQDN that you're using. I'm quite confident that this is not the intented interpretation of the standards to which you're referring, in large part because I was participating in the mailing lists on which they were written. This is not only me. hostname -f uses the same definition. There's also the open problem of what canonical name means under Debian / Linux. Some software also assumes the unicity of the FQDN (under the hostname -f definition), and even the nodename (e.g. that's procmail when storing mail in a Maildir mailbox). -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
[Iustin Pop] the FQDN should be available directly on the host, without external dependencies. Which is why I personally think the machine name (the one that the kernel knows) should hold the canonical name. I agree, and I always make sure /etc/hostname is the FQDN or something close to it on machines I run. We do the same at the university where I work, on all Unix versions that are capable of storing the long names (had some problems with older HP-UX, not sure we have any Unix versions left which refused hostnames 8 characters). Happy hacking, -- Petter Reinholdtsen -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
OoO En cette nuit nuageuse du jeudi 31 décembre 2009, vers 01:16, Sam Morris s...@robots.org.uk disait : Adding meaningless configuration to work around programs that are broken by design does not seem like a good solution. There are a lot of programs requiring some kind of FQDN (for example because they implement a protocol requiring it). How should they get it? I have never seen a more universal that to get node name with uname(), then use gethostbyname(). Please, provide better way. The admin should supply it in the program's configuration, since only the admin is able to know the correct value. Sure, the admin would have to configure a whole set of programs instead of just configuring the canonical name in one unique place of the system and let each program that needs it to autodiscover it? This does not preclude the possibility to override what has been discovered on a case by case basis. -- panic (No CPUs found. System halted.\n); 2.4.3 linux/arch/parisc/kernel/setup.c pgpsJCTUzoBfc.pgp Description: PGP signature
Re: where is /etc/hosts supposed to come from?
On 2009-12-30, Henrique de Moraes Holschuh h...@debian.org wrote: On Wed, 30 Dec 2009, Philipp Kern wrote: You don't switch to v6-only, you switch to dual stack IPv4+IPv6. One point being that with a v6-only host you're totally unable to reach IPv4 sites without the help of application-level proxies. That's false. You can use protocol-level gateways, which do NAT and PT (protocol translation). Can you point me to one please? I found that deprecated and entirely unsupported. But if there's a software for that available... Kind regards, Philipp Kern -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Thu, 31 Dec 2009, Philipp Kern wrote: On 2009-12-30, Henrique de Moraes Holschuh h...@debian.org wrote: On Wed, 30 Dec 2009, Philipp Kern wrote: You don't switch to v6-only, you switch to dual stack IPv4+IPv6. One point being that with a v6-only host you're totally unable to reach IPv4 sites without the help of application-level proxies. That's false. You can use protocol-level gateways, which do NAT and PT (protocol translation). Can you point me to one please? I found that deprecated and entirely unsupported. But if there's a software for that available... Cisco boxes... -- One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie. -- The Silicon Valley Tarot Henrique Holschuh -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-30 15:31:12 -0200, Henrique de Moraes Holschuh wrote: On Tue, 29 Dec 2009, Vincent Lefevre wrote: On 2009-12-29 17:44:31 +0100, Milan P. Stanic wrote: Mutt in testing/unstable use /etc/mailname. But not the official Mutt version. Who lets you configure the correct domain you want it to use for email addresses in its config files, although I don't recall if you can tell it what to use for message-ids. Yes, that's what I had to do after reporting Mutt bug 3298 (Mutt has its own buggy way to determine the FQDN: it uses /etc/resolv.conf while /etc/hosts may have the precedence). Debian mutt will autoconfigure better, but that's it. That said, the canonical name is required by POSIX, but POSIX (looking at SuSv3) doesn't require it to be unique, doesn't give it any application usage notes, and in fact doesn't even require it to be a FQDN (which is, in fact a pratical requirement of the stuff that uses the canonical name). POSIX says: If the AI_CANONNAME flag is specified and the nodename argument is not null, the function shall attempt to determine the canonical name corresponding to nodename (for example, if nodename is an alias or shorthand notation for a complete name). ^^ So, it isn't intended to be a short name. As this is mostly implementation defined, it may be difficult to be very accurate. Also, otherwise, what would be the point of having a canonical name in addition to a node name if there isn't any requirement? If you want proper message-ids, do it right and have a GUUID in it. Perhaps, hoping that Message-Ids wouldn't be too long (I've seen broken messages due to Message-Ids generated by Pine, related to word-wrapping IIRC). If mutt depends on the result of gethostname() to be unique in the whole world to generate proper message-ids, it is broken. Actually, there's a low probability of duplicates (but practically possible) if many people use a broken FQDN such as localhost. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Thu, Dec 31, 2009 at 02:02:36PM +0100, Vincent Lefevre wrote: POSIX says: If the AI_CANONNAME flag is specified and the nodename argument is not null, the function shall attempt to determine the canonical name corresponding to nodename (for example, if nodename is an alias or shorthand notation for a complete name). ^^ So, it isn't intended to be a short name. As this is mostly implementation defined, it may be difficult to be very accurate. Where does the above say it must be a FQDN ? It says that *for example*, *if* nodename is blah blah. So, what if the nodename is *not* that ? (which it is not on a lot of hosts) Mike -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-30 11:54:57 -0800, Russ Allbery wrote: Vincent Lefevre vinc...@vinc17.org writes: stanford.edu is definitely wrong. First it's just a domain name, not a FQDN (as required by the mailname(5) man page). stanford.edu is an RFC 1035 FQDN. RFC 1035 (from /usr/share/doc/RFC/links/rfc1035.txt.gz) doesn't define what a FQDN is. It doesn't contain FQDN, and the only occurrence of fully and qualified is in Gateways will also have host level pointers at their fully qualified addresses. FYI, here's what Wikipedia[*] (though not authoritative and sometimes containing errors) says: For example, given a device with a local hostname myhost and a parent domain name example.com, the fully qualified domain name is written as myhost.example.com. This fully qualified domain name therefore uniquely identifies the host — while there may be many resources in the world called myhost, there is only one myhost.example.com. [*] http://en.wikipedia.org/wiki/Fully_qualified_domain_name This would meen that two different machines could generate the same Message-Id; the right part of @ in a Message-Id should contain the hostname to avoid this kind of problems. The term message ID appears nowhere in the description of /etc/mailname. Why do you think it's supposed to be used for generating message IDs? Earlier in the discussion: Anything mail related must use /etc/mailname if it needs something ^ that can be translated to an IP address. It is specifically intended for generating e-mail addresses. In such a case, hostname -f (or equivalent) is still useful to generate message-ids. And the Debian mailname(5) man page doesn't say e-mail addresses specifically. Moreover, concerning the e-mail addresses, root is local to the machine, so that generating a mail from r...@stanford.edu is incorrect. You do not know either that root is local to my system or that r...@stanford.edu is incorrect for it. Both of those are configuration *choices*, not requirements. But r...@stanford.edu wouldn't be the same root. Perhaps the Debian mailname(5) man page should make clear what is intended for local users and use consistent terminology. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-30 15:33:05 -0200, Henrique de Moraes Holschuh wrote: Better correct myself here. POSIX provides a way for apps to query the canonical host name, but DOES NOT REQUIRE IT TO BE A FQDN. So, it provided the notion of a special name, the canonical host name. In practice, it has to be a FQDN, but that's due to bad usage by applications, not a POSIX (or SuSv3) requirement. One problem is that it seems to be the only way to get the FQDN of the host. FYI, I use the FQDN as a way to identify the hosts (and a FQDN is more meaningful and probably more stable than an arbitrary UUID). But I don't know any software that tries to resolve the FQDN, except broken MTAs that reject mail if they can't resolve the FQDN, despite the fact that the client is on a private network. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-31 14:10:46 +0100, Mike Hommey wrote: On Thu, Dec 31, 2009 at 02:02:36PM +0100, Vincent Lefevre wrote: POSIX says: If the AI_CANONNAME flag is specified and the nodename argument is not null, the function shall attempt to determine the canonical name corresponding to nodename (for example, if nodename is an alias or shorthand notation for a complete name). ^^ So, it isn't intended to be a short name. As this is mostly implementation defined, it may be difficult to be very accurate. Where does the above say it must be a FQDN ? It says that *for example*, *if* nodename is blah blah. So, what if the nodename is *not* that ? (which it is not on a lot of hosts) If it is not that, it is the complete name. But since it is implementation-defined, which Debian's document defines the canonical name? Do you suggest that getnameinfo() be used to get the FQDN? -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Dec 31, 2009, at 15:04, Vincent Lefevre wrote: On 2009-12-31 14:10:46 +0100, Mike Hommey wrote: On Thu, Dec 31, 2009 at 02:02:36PM +0100, Vincent Lefevre wrote: POSIX says: Have we resolved where the canonical hostname is going to reside or does reside? Debian's policy manual[0] states that `hostname --fqdn` is where this information should be gathered from. Is that the canonical method? Jeremiah 0. http://www.debian.org/doc/debian-policy/ch-customized-programs.html -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Thu, Dec 31, 2009 at 04:12:30PM +0100, Jeremiah Foster wrote: On Dec 31, 2009, at 15:04, Vincent Lefevre wrote: On 2009-12-31 14:10:46 +0100, Mike Hommey wrote: On Thu, Dec 31, 2009 at 02:02:36PM +0100, Vincent Lefevre wrote: POSIX says: Have we resolved where the canonical hostname is going to reside or does reside? Debian's policy manual[0] states that `hostname --fqdn` is where this information should be gathered from. Is that the canonical method? This is a personal opinion, but having the canonical name rely on “hostname --fqdn” is not a favorite of mine: hostname needs the resolver to be working and functioning (e.g. it talks to your nameservers if /etc/hosts doesn't contain your hostname/ip already). IMHVO, this is a brittle setup and the FQDN should be available directly on the host, without external dependencies. Which is why I personally think the machine name (the one that the kernel knows) should hold the canonical name. Just my opinion, no need to flame - I know I lost this argument many times already. regards, iustin -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Hi, On Wed, Dec 30, 2009 at 03:18:51PM -0200, Henrique de Moraes Holschuh wrote: I prefer to allocate such host names in a real domain, and give them just TXT records or 127.0.1.1 A records in some weird cases where I can't trust the box to not do idiotic things like go to the DNS bypassing the libc resolver. Yes. This is certainly good thing to do. But how many people outside of DD world have a real domain controlled by them which is usable for this purpose. On Thu, Dec 31, 2009 at 11:11:00AM +1100, Brian May wrote: I wouldn't use .local as that seems to be treated as a special case by zeroconf enabled computers, and various OS seem to have zeroconf enabled by default (like it or not). I do this now expecting no name crash since I do not think I connect to any host with the same host name and such domain name in my lan. (If you are in zeroconf enabled lan and someone on the lan has the same host name, isn't it a problem by itself?) I know, according to rfc2606, invalid seems to be a choice for the top level domain (TLD) to construct domain names that are sure to be invalid from the Internet. But result is the same as choosing local. (This was a choice which I used to use.) I summarized this at: http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_domain_name and the following section. If there is a better guideline for normal people to follow, please give me pinter. Osamu -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-31, Osamu Aoki os...@debian.org wrote: I know, according to rfc2606, invalid seems to be a choice for the top level domain (TLD) to construct domain names that are sure to be invalid from the Internet. But result is the same as choosing local. (This was a choice which I used to use.) Using .local in own environments sadly clashes with the (I think now installed by default) mDNS namespace for locally-resolvable hostnames. But it somehow makes sense for a laptop; it would even resolve. ;-) Kind regards, Philipp Kern -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Vincent Lefevre vinc...@vinc17.org writes: On 2009-12-30 11:54:57 -0800, Russ Allbery wrote: Vincent Lefevre vinc...@vinc17.org writes: stanford.edu is definitely wrong. First it's just a domain name, not a FQDN (as required by the mailname(5) man page). stanford.edu is an RFC 1035 FQDN. RFC 1035 (from /usr/share/doc/RFC/links/rfc1035.txt.gz) doesn't define what a FQDN is. It doesn't contain FQDN, and the only occurrence of fully and qualified is in Gateways will also have host level pointers at their fully qualified addresses. However, the other standards that do talk about FQDNs refer to RFC 1035 for the definition. See, for instance, RFC 5322. FYI, here's what Wikipedia[*] (though not authoritative and sometimes containing errors) says: For example, given a device with a local hostname myhost and a parent domain name example.com, the fully qualified domain name is written as myhost.example.com. This fully qualified domain name therefore uniquely identifies the host — while there may be many resources in the world called myhost, there is only one myhost.example.com. You're right, that's not authoritative and, in this case, is misleading. Nothing about an FDQN implies uniqueness. Wikipedia is trying to get at the distinction between an unqualified name, which could duplicate many other unqualified names in other domains, and a fully-qualified name which has a single location in the DNS hierarchy. However, an FQDN, despite living in one place in the DNS hierarchy, may refer to multiple separate systems (as it does for stanford.edu, time.stanford.edu, etc., all of which are FQDNs). -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-31 16:35:58 +0100, Iustin Pop wrote: This is a personal opinion, but having the canonical name rely on “hostname --fqdn” is not a favorite of mine: hostname needs the resolver to be working and functioning (e.g. it talks to your nameservers if /etc/hosts doesn't contain your hostname/ip already). Well, the practice, the FQDN is often available via /etc/hosts. IMHVO, this is a brittle setup and the FQDN should be available directly on the host, without external dependencies. Which is why I personally think the machine name (the one that the kernel knows) should hold the canonical name. Either that, or having the FQDN in /etc/hosts. I don't see any problem with that, excepts that iceweasel doesn't cope very well with this: lrwxrwxrwx 1 vinc17 vinc17 15 2009-12-30 05:35:38 lock - 127.0.1.1:+5537 I wonder why it doesn't use the FQDN. The IP addresse 127.0.1.1 is incorrect when the directory is shared with other hosts. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-31 12:37:25 -0800, Russ Allbery wrote: Vincent Lefevre vinc...@vinc17.org writes: On 2009-12-30 11:54:57 -0800, Russ Allbery wrote: Vincent Lefevre vinc...@vinc17.org writes: stanford.edu is definitely wrong. First it's just a domain name, not a FQDN (as required by the mailname(5) man page). stanford.edu is an RFC 1035 FQDN. RFC 1035 (from /usr/share/doc/RFC/links/rfc1035.txt.gz) doesn't define what a FQDN is. It doesn't contain FQDN, and the only occurrence of fully and qualified is in Gateways will also have host level pointers at their fully qualified addresses. However, the other standards that do talk about FQDNs refer to RFC 1035 for the definition. See, for instance, RFC 5322. RFC 5322 doesn't mention FQDN, fully or qualified either! Perhaps you meant RFC 5321, which uses FQDN with a different meaning, and uses primary host name for what is a FQDN here. RFC 5321 also says In the EHLO command, the host sending the command identifies itself, implying that what you give after EHLO must be unique (otherwise that's no longer an identification). FYI, here's what Wikipedia[*] (though not authoritative and sometimes containing errors) says: For example, given a device with a local hostname myhost and a parent domain name example.com, the fully qualified domain name is written as myhost.example.com. This fully qualified domain name therefore uniquely identifies the host — while there may be many resources in the world called myhost, there is only one myhost.example.com. You're right, that's not authoritative and, in this case, is misleading. Nothing about an FDQN implies uniqueness. Wikipedia is trying to get at the distinction between an unqualified name, which could duplicate many other unqualified names in other domains, and a fully-qualified name which has a single location in the DNS hierarchy. However, an FQDN, despite living in one place in the DNS hierarchy, may refer to multiple separate systems (as it does for stanford.edu, time.stanford.edu, etc., all of which are FQDNs). No, they are not FQDNs of the corresponding hosts. For instance, time.stanford.edu resolves to 3 IP addresses (3 hosts, I suppose): time.stanford.edu has address 171.64.7.105 time.stanford.edu has address 171.64.7.67 time.stanford.edu has address 204.63.224.70 xvii% host 171.64.7.105 105.7.64.171.in-addr.arpa domain name pointer time-a.Stanford.EDU. xvii% host 171.64.7.67 67.7.64.171.in-addr.arpa domain name pointer time-b.Stanford.EDU. xvii% host 204.63.224.70 70.224.63.204.in-addr.arpa domain name pointer time-c.Stanford.EDU. The respective FQDN's of these hosts seem to be time-a.Stanford.EDU, time-b.Stanford.EDU and time-c.Stanford.EDU, and they are unique: they all resolve to a *single* IP address. xvii% host time-a.Stanford.EDU time-a.Stanford.EDU has address 171.64.7.105 xvii% host time-b.Stanford.EDU time-b.Stanford.EDU has address 171.64.7.67 xvii% host time-c.Stanford.EDU time-c.Stanford.EDU has address 204.63.224.70 Note: this is a heuristic only; the only way to be sure that they are the FQDN's of the host (as returned by hostname -f) is to test on the machines themselves. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Vincent Lefevre vinc...@vinc17.org writes: RFC 5322 doesn't mention FQDN, fully or qualified either! Perhaps you meant RFC 5321, which uses FQDN with a different meaning, and uses primary host name for what is a FQDN here. Sorry, yes, that's the one I meant. The mail format standard defines for itself what, in essence, an FQDN is, but it doesn't use that terminology and it does so only in the context of e-mail addresses. RFC 5321 also says In the EHLO command, the host sending the command identifies itself, implying that what you give after EHLO must be unique (otherwise that's no longer an identification). Uh, no. That statement implies nothing of the sort; identification is not necessarily unique. On 2009-12-31 12:37:25 -0800, Russ Allbery wrote: You're right, that's not authoritative and, in this case, is misleading. Nothing about an FDQN implies uniqueness. Wikipedia is trying to get at the distinction between an unqualified name, which could duplicate many other unqualified names in other domains, and a fully-qualified name which has a single location in the DNS hierarchy. However, an FQDN, despite living in one place in the DNS hierarchy, may refer to multiple separate systems (as it does for stanford.edu, time.stanford.edu, etc., all of which are FQDNs). No, they are not FQDNs of the corresponding hosts. For instance, time.stanford.edu resolves to 3 IP addresses (3 hosts, I suppose): I've been participating in standardization of network protocols through the IETF for more than a decade now, and I've never seen someone use this definition of FQDN that you're using. I'm quite confident that this is not the intented interpretation of the standards to which you're referring, in large part because I was participating in the mailing lists on which they were written. I'm going to bow out at this point, since I don't think either of us are going to convince each other and so far as I can tell, no concrete change is being proposed, so this is all sort of pointless. If someone proposes a concrete change, that's the point at which this all becomes relevant to debate. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Thu, Dec 31, 2009 at 04:33:44PM +, Philipp Kern wrote: On 2009-12-31, Osamu Aoki os...@debian.org wrote: I know, according to rfc2606, invalid seems to be a choice for the top level domain (TLD) to construct domain names that are sure to be invalid from the Internet. But result is the same as choosing local. (This was a choice which I used to use.) Using .local in own environments sadly clashes with the (I think now installed by default) mDNS namespace for locally-resolvable hostnames. But it somehow makes sense for a laptop; it would even resolve. ;-) Yes, that is what I was getting at too. It is also a problem for Mac OS X boxes, at least without fiddling. This can be a problem even if you don't intend to use zeroconf/mdns on your network. Typically what happens is DNS queries time out without resolving and packet traces show that there are no requests happening. I don't know of any good choice for a TLD that is guaranteed not to be used on the Internet, although currently I am using .pri (short for .private) here. Even .local is only mentioned in a experimental RFC that had expired (at least last I checked which was a while ago now). In case any is confused of the relationship between mdns and zeroconf: Package: libnss-mdns Priority: optional Section: admin Installed-Size: 152 Maintainer: Ubuntu Core developers ubuntu-devel-disc...@lists.ubuntu.com Original-Maintainer: Utopia Maintenance Team pkg-utopia-maintain...@lists.alioth.debian.org Architecture: amd64 Source: nss-mdns Version: 0.10-3ubuntu3 Depends: libc6 (= 2.4), base-files (= 3.1.10), perl, avahi-daemon (= 0.6.16-1) Suggests: avahi-autoipd | zeroconf Filename: pool/main/n/nss-mdns/libnss-mdns_0.10-3ubuntu3_amd64.deb Size: 25830 MD5sum: 622ed99ad2e7bc6b7f7ad95eb51e12fe SHA1: a3bc1ead6d63e48d60f6c529778dfc9d9df00637 SHA256: 3206f5a6ceecc3838781b758a50443df7b54146677d94d790658cc9de1a60c56 Description: NSS module for Multicast DNS name resolution nss-mdns is a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (glibc) providing host name resolution via Multicast DNS (using Zeroconf, aka Apple Bonjour / Apple Rendezvous ), effectively allowing name resolution by common Unix/Linux programs in the ad-hoc mDNS domain .local. Bugs: https://bugs.launchpad.net/ubuntu/+filebug Origin: Ubuntu Task: ubuntu-desktop, eucalyptus-node, eucalyptus-simple-cluster, print-server, kubuntu-desktop, kubuntu-netbook, edubuntu-desktop, xubuntu-desktop, mobile-mid, ubuntu-netbook-remix -- Brian May b...@snoopy.debian.net -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Tue, Dec 29, 2009 at 10:31:25PM +0100, Vincent Lefevre wrote: Well, the node name is unique. From that, you'll obtain the FQDN with either the obsolete function gethostbyname or the new POSIX function getaddrinfo (by using the AI_CANONNAME flag). POSIX says: If the AI_CANONNAME flag is specified and the nodename argument is not null, the function shall attempt to determine the canonical name corresponding to nodename (for example, if nodename is an alias or shorthand notation for a complete name). Read what you have written: _attempt_. It does not say that you can expect it to succeed even in common situations. And here's what the getaddrinfo(3) man page says under Debian: If hints.ai_flags includes the AI_CANONNAME flag, then the ai_canonname field of the first of the addrinfo structures in the returned list is set to point to the official name of the host. Then you need to configure your machine according to the spec, i.e. you need a single FQDN / canonical name / official name of the host. If getaddrinfo(AI_CANONNAME) fails, that is fully conformant with the spec you have quoted. Example: there is a router box called gw which has about a dozen addresses that resolve to gw.domain for just as many domains. Some addresses even share the same NIC. Which FQDN should hostname -f display? This doesn't really matter. The FQDN may also be another name, i.e. the nodename may be something more meaningful than gw. But it is not. This is a real world example. Reality does not match your dream world. Why that one, and not some other? You should ask this question to those who configured such routers (but this would be more a practical matter, as you may have plenty of choices). _I_ did configure it. I _know_ that none of the addresses is more important than the other. And you know, if you do not pretend such silly things that a host should have just a single FQDN or that hostname -f should return anything meaningful, then the above configuration works flawlessly. Only if you start to pretend things that are simply not true you start having problems. A FQDN is not associated with an IP address, but with a host. You cannot call them FQDN, which already has a well-established meaning. Now this is bullshit. FQDN is a term related to DNS. An FQDN resolves to a set of resource records, which may be IPv4 or IPv6 addresses and a couple of other things, but definitely _NOT_ hosts, as that term has no meaning for the DNS. If the FQDN resolves to multiple IP addresses, then the very same FQDN can belong to multiple hosts simultaneously. Similarly, if a host has multiple IP addresses, then multiple FQDNs may point to it. You can even mix these: - host1 has addresses 192.168.1.1 and 192.168.2.1 - host2 has addresses 192.168.1.2 and 192.168.2.2 - the DNS has the following records: service1.domain.IN A 192.168.1.1 IN A 192.168.1.2 service2.domain.IN A 192.168.2.1 IN A 192.168.2.2 Now both hosts has two FQDNs, and both FQDNs point to two hosts; neither host1 nor host2 is resolvable. And it all works just fine if you do not make invalid assumptions about what FQDNs are and how they are used. If I understand correctly, you do a reverse DNS lookup. Now, I'm wondering... Can a hostname obtained by reverse DNS lookup resolve to different IP addresses? Of course it can. And it is common to refuse connections from such hosts using the PARANOID option of TCP wrappers (which was first released more than 18 years ago, so don't pretend it is some new thing). hostname -f just follows the POSIX notion of canonical name (a.k.a. FQDN). So, I doubt it will die. Please quote the exact text from POSIX that says that - there MUST be a canonical name, - and that name MUST be an FQDN. Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Wed, Dec 30, 2009 at 02:36:12AM +0100, Vincent Lefevre wrote: BTW, Debian defines /etc/mailname as containing the FQDN. So, this notion is explicitly defined on Debian, and one should expect hostname -f to return the same name (according to its documentation). What makes you think that /etc/mailname should have any resemblance to the host name? Did you never administer a host that used a dedicated IP address for sending/receiving mail, and did any other communication on different addresses? Leaking the real host name in such a situation can be considered a serious security issue... Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Wed, Dec 30, 2009 at 08:37:21AM +0100, Vincent Bernat wrote: If this is a real question, put: 127.0.1.1 fqdn nodename This seems a very acceptable way to give a FQDN to your laptop without relying on network. hostname -f and programs using a similar inner working will be able to get the right result. Adding meaningless configuration to work around programs that are broken by design does not seem like a good solution. Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29, Adam Borowski kilob...@angband.pl wrote: It's not hypothetical. IPv4 sucks so badly compared to IPv6 that once you switch your internal hosts to v6-only, you don't want to go back. You don't switch to v6-only, you switch to dual stack IPv4+IPv6. One point being that with a v6-only host you're totally unable to reach IPv4 sites without the help of application-level proxies. Kind regards, Philipp Kern -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Wed, Dec 30, 2009 at 11:12:41AM +, Philipp Kern wrote: On 2009-12-29, Adam Borowski kilob...@angband.pl wrote: It's not hypothetical. IPv4 sucks so badly compared to IPv6 that once you switch your internal hosts to v6-only, you don't want to go back. You don't switch to v6-only, you switch to dual stack IPv4+IPv6. One point being that with a v6-only host you're totally unable to reach IPv4 sites without the help of application-level proxies. Dual stack means you have to configure BOTH. Of course, that's needed for world-facing servers only. Client machines will want dual stack too, but these can be behind plain outgoing-only NAT v4-wise. I can't think of a reason to keep IPv4 on internal servers, though. In fact, this does give you an extra layer of security if you firewall something wrong: when an IPv6-only box gets pwned, it's of little use for your usual attacker. The main benefit of IPv6 is making things simpler, and dual stacking doesn't help there. -- 1KB // Microsoft corollary to Hanlon's razor: // Never attribute to stupidity what can be // adequately explained by malice. -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29 20:23:31 -0800, Russ Allbery wrote: I'm having a hard time figuring out what you think the canonical name of my laptop could possibly be, given that it has no static IP address and no DNS entry. It doesn't need to have a static IP, nor a DNS entry. In practice, it's whatever arbitrary label that I gave it, Yes, it may be arbitrary (the main goal being to identify the machine). and none of these DNS-based resolution techniques are going to do you much good or give you any sort of consistent answer, if they work at all. If it doesn't make sense (e.g., you can't connect to the machine from the outside), they don't need to work... well, only locally, but it has been said that 127.0.1.1 is typically used for that. I have no entry in /etc/hosts other than 127.0.0.1 and the corresponding IPv6 entries. What could I possibly put in there? As said by Steve Langasek in 2009122753.ga19...@dario.dodds.net, something of the form: 127.0.1.1 nodename.domainname This is implementation-defined, but still, the host has a canonical name, that should be obtainable with getaddrinfo, as described. I don't see where you're finding any justification for that should in POSIX. Otherwise this would be a failure, and failures are things that one wants to avoid. BTW, Debian defines /etc/mailname as containing the FQDN. So, this notion is explicitly defined on Debian, and one should expect hostname -f to return the same name (according to its documentation). No, it's not. You have completely misunderstood the purpose of /etc/mailname. No, this is what is documented. You should RTFM. If your package needs to know what hostname to use on (for example) outgoing news and mail messages which are generated locally, you should use the file /etc/mailname. It will contain the portion after the username and @ (at) sign for email addresses of users on the machine (followed by a newline). So on my system, for instance, /etc/mailname is stanford.edu, because that's what goes on the RHS of e-mail addresses. Which, of course, is not the canonical name of my laptop. stanford.edu is definitely wrong. First it's just a domain name, not a FQDN (as required by the mailname(5) man page). This would meen that two different machines could generate the same Message-Id; the right part of @ in a Message-Id should contain the hostname to avoid this kind of problems. Moreover, concerning the e-mail addresses, root is local to the machine, so that generating a mail from r...@stanford.edu is incorrect. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-30 11:56:13 +0100, Gabor Gombas wrote: On Tue, Dec 29, 2009 at 10:31:25PM +0100, Vincent Lefevre wrote: Then you need to configure your machine according to the spec, i.e. you need a single FQDN / canonical name / official name of the host. If getaddrinfo(AI_CANONNAME) fails, that is fully conformant with the spec you have quoted. But that's a ***FAILURE***. Don't assume that things will work perfectly in such a case. Example: there is a router box called gw which has about a dozen addresses that resolve to gw.domain for just as many domains. Some addresses even share the same NIC. Which FQDN should hostname -f display? This doesn't really matter. The FQDN may also be another name, i.e. the nodename may be something more meaningful than gw. But it is not. This is a real world example. Reality does not match your dream world. Could you please read again what I've written? I've said *may*. gw is fine too, if you really want. No theoratical problem with that. You should ask this question to those who configured such routers (but this would be more a practical matter, as you may have plenty of choices). _I_ did configure it. I _know_ that none of the addresses is more important than the other. So what? And you know, if you do not pretend such silly things that a host should have just a single FQDN or that hostname -f should return anything meaningful, then the above configuration works flawlessly. Only if you start to pretend things that are simply not true you start having problems. I'm not pretending, this is how it is. RTFM. A FQDN is not associated with an IP address, but with a host. You cannot call them FQDN, which already has a well-established meaning. Now this is bullshit. FQDN is a term related to DNS. Wrong. /etc/hosts (which is commonly used for the FQDN) has nothing to do with DNS. An FQDN resolves to a set of resource records, which may be IPv4 or IPv6 addresses and a couple of other things, but definitely _NOT_ hosts, as that term has no meaning for the DNS. I've never said that a FQDN resolves to hosts. If the FQDN resolves to multiple IP addresses, then the very same FQDN can belong to multiple hosts simultaneously. I'd say that's an incorrect configuration. Several mechanisms may fail in such a case (e.g. Message-Id generation). Similarly, if a host has multiple IP addresses, then multiple FQDNs may point to it. You can even mix these: - host1 has addresses 192.168.1.1 and 192.168.2.1 - host2 has addresses 192.168.1.2 and 192.168.2.2 - the DNS has the following records: service1.domain.IN A 192.168.1.1 IN A 192.168.1.2 service2.domain.IN A 192.168.2.1 IN A 192.168.2.2 One often uses CNAME for services, or the FQDN may be a bit more hidden. For instance: $ host www.google.com www.google.com is an alias for www.l.google.com. www.l.google.com has address 209.85.227.106 www.l.google.com has address 209.85.227.147 www.l.google.com has address 209.85.227.99 www.l.google.com has address 209.85.227.103 www.l.google.com has address 209.85.227.104 www.l.google.com has address 209.85.227.105 $ host 209.85.227.106 106.227.85.209.in-addr.arpa domain name pointer wy-in-f106.1e100.net. $ host 209.85.227.147 147.227.85.209.in-addr.arpa domain name pointer wy-in-f147.1e100.net. and so on. (I'm not saying that wy-in-f106.1e100.net, wy-in-f147.1e100.net and so on are the FQDN's of these hosts, but this is probably the case.) In your example, host1.domain and host2.domain could be the respective FQDN's of these hosts, that could resolve as 127.0.1.1 locally on each machine. If I understand correctly, you do a reverse DNS lookup. Now, I'm wondering... Can a hostname obtained by reverse DNS lookup resolve to different IP addresses? Of course it can. So, this would mean that your new option --all-fqdns would lie, as it could give IP's belonging to other machines. hostname -f just follows the POSIX notion of canonical name (a.k.a. FQDN). So, I doubt it will die. Please quote the exact text from POSIX that says that - there MUST be a canonical name, - and that name MUST be an FQDN. For instance, under getnameinfo(): The flags argument is a flag that changes the default actions of the function. By default the fully-qualified domain name (FQDN) for the host shall be returned, but: This means that a host *has* a FQDN (POSIX doesn't say if there is one and something like that). It is just an implementation-defined property of the system. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact
Re: where is /etc/hosts supposed to come from?
In article 20091229135244.gc26...@xvii.vinc17.org you wrote: When the machine is correctly configured (i.e. really has a FQDN), hostname -f is reliable. But note that this is Debian-specific. It is not. It is net-tools specific, hostname -f uses gethostbyname. If you only want the node name, and if the node name is fqdn, you can use hostname or hostname -s to get it with or without the domain. Besides that, I would allow FQDN in /etc/hostname Gruss Bernd -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Tue, 29 Dec 2009, Russ Allbery wrote: If this is a real question, put: 127.0.1.1 fqdn nodename I think we're having some sort of fundamental misunderstanding or communications gap here. What FQDN do you think I should put there? Should I just make something up, like laptop.russ.allbery? Yes, if you must/want. I prefer to alocate such host names in a real domain, and give them just TXT records or 127.0.1.1 A records in some weird cases where I can't trust the box to not do idiotic things like go to the DNS bypassing the libc resolver. Any arbritary but valid and unique DNS name would do. People often use .local suffixes when doing that, I've seen .local, .localnet and many others. In truth, my laptop *does not have an FQDN*. The concept has no useful It must have, POSIX provided a way for apps to query it, and apps started doing that. So you need one. It will be an arbitrary one, but that's fine. You seem to have a basic assumption that every given machine can, at the end of the day, be assigned a unique home in DNS that is somehow more legitimate and more correctly defines that system than any other. This is simply not the case in several practical real-world situations. Well, sorry, but since gethostname() and friends exist and are used, there IS a special name which is the box main 'identity'. That one needs to be there, needs to be sane, and most apps that use it will require it to resolve to something that works (that's what the loopback is for). Whether an application should be using gethostname() at all is a different problem. Give your box an GUID as its canonical name, if you want. Change at every boot, if you want. Add a .local suffix to it to make it a FQDN (since too much stuff is too broken to undestand a top-level FQDN). As long as it is resovable by the box itself, that's a perfectly fully functional canonical host name. As with a few other people commenting on this thread, I usually shrug and pick an arbitrary one of the DNS names assigned to a multihomed box to be the real name for hostname, since usually it doesn't matter. But I You are quite correct in that. -- One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie. -- The Silicon Valley Tarot Henrique Holschuh -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Tue, 29 Dec 2009, Vincent Lefevre wrote: On 2009-12-29 17:44:31 +0100, Milan P. Stanic wrote: Mutt in testing/unstable use /etc/mailname. But not the official Mutt version. Who lets you configure the correct domain you want it to use for email addresses in its config files, although I don't recall if you can tell it what to use for message-ids. Debian mutt will autoconfigure better, but that's it. That said, the canonical name is required by POSIX, but POSIX (looking at SuSv3) doesn't require it to be unique, doesn't give it any application usage notes, and in fact doesn't even require it to be a FQDN (which is, in fact a pratical requirement of the stuff that uses the canonical name). If you want proper message-ids, do it right and have a GUUID in it. If mutt depends on the result of gethostname() to be unique in the whole world to generate proper message-ids, it is broken. -- One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie. -- The Silicon Valley Tarot Henrique Holschuh -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Wed, 30 Dec 2009, Henrique de Moraes Holschuh wrote: In truth, my laptop *does not have an FQDN*. The concept has no useful It must have, POSIX provided a way for apps to query it, and apps started doing that. So you need one. It will be an arbitrary one, but that's fine. Better correct myself here. POSIX provides a way for apps to query the canonical host name, but DOES NOT REQUIRE IT TO BE A FQDN. So, it provided the notion of a special name, the canonical host name. In practice, it has to be a FQDN, but that's due to bad usage by applications, not a POSIX (or SuSv3) requirement. And anything that depends on it to be unique in the whole world is broken. -- One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie. -- The Silicon Valley Tarot Henrique Holschuh -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Wed, 30 Dec 2009, Philipp Kern wrote: You don't switch to v6-only, you switch to dual stack IPv4+IPv6. One point being that with a v6-only host you're totally unable to reach IPv4 sites without the help of application-level proxies. That's false. You can use protocol-level gateways, which do NAT and PT (protocol translation). But you are much better off with application-level proxies. -- One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie. -- The Silicon Valley Tarot Henrique Holschuh -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Vincent Lefevre vinc...@vinc17.org writes: On 2009-12-29 20:23:31 -0800, Russ Allbery wrote: No, it's not. You have completely misunderstood the purpose of /etc/mailname. No, this is what is documented. You should RTFM. Er, yes, I have, several times. It's something that one does when one is maintaining the manual in question. If your package needs to know what hostname to use on (for example) outgoing news and mail messages which are generated locally, you should use the file /etc/mailname. It will contain the portion after the username and @ (at) sign for email addresses of users on the machine (followed by a newline). So on my system, for instance, /etc/mailname is stanford.edu, because that's what goes on the RHS of e-mail addresses. Which, of course, is not the canonical name of my laptop. stanford.edu is definitely wrong. First it's just a domain name, not a FQDN (as required by the mailname(5) man page). stanford.edu is an RFC 1035 FQDN. I've watched N different iterations of the discussion of exactly what is an FQDN in various IETF lists, and while there are some strange corner cases, (va, for instance), stanford.edu isn't one of them. You'll observe that the grammar in RFC 1035 matches it just fine, and all of the requirements stated for it in RFC 1035 are met. This would meen that two different machines could generate the same Message-Id; the right part of @ in a Message-Id should contain the hostname to avoid this kind of problems. The term message ID appears nowhere in the description of /etc/mailname. Why do you think it's supposed to be used for generating message IDs? It is specifically intended for generating e-mail addresses. Moreover, concerning the e-mail addresses, root is local to the machine, so that generating a mail from r...@stanford.edu is incorrect. You do not know either that root is local to my system or that r...@stanford.edu is incorrect for it. Both of those are configuration *choices*, not requirements. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Henrique de Moraes Holschuh h...@debian.org writes: On Tue, 29 Dec 2009, Russ Allbery wrote: In truth, my laptop *does not have an FQDN*. The concept has no useful It must have, POSIX provided a way for apps to query it, and apps started doing that. So you need one. It will be an arbitrary one, but that's fine. The fact that my laptop is working just fine, running Debian unstable, without having any such thing seems to point out a conflict between your statement and reality. Well, sorry, but since gethostname() and friends exist and are used, there IS a special name which is the box main 'identity'. That one needs to be there, needs to be sane, and most apps that use it will require it to resolve to something that works (that's what the loopback is for). gethostname() for my laptop returns a string which is neither fully-qualified nor resolves to anything in either DNS or /etc/hosts. Which apps break exactly? I should start filing bugs against them. Give your box an GUID as its canonical name, if you want. Change at every boot, if you want. Add a .local suffix to it to make it a FQDN (since too much stuff is too broken to undestand a top-level FQDN). As long as it is resovable by the box itself, that's a perfectly fully functional canonical host name. I don't see why I should have to do any of those things just to satisfy your misreading of the POSIX standard, when in practice the applications I run seem to work just fine. If there are buggy applications that break, they should be fixed. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Henrique de Moraes Holschuh h...@debian.org writes: On Wed, 30 Dec 2009, Henrique de Moraes Holschuh wrote: In truth, my laptop *does not have an FQDN*. The concept has no useful It must have, POSIX provided a way for apps to query it, and apps started doing that. So you need one. It will be an arbitrary one, but that's fine. Better correct myself here. POSIX provides a way for apps to query the canonical host name, but DOES NOT REQUIRE IT TO BE A FQDN. Ack, sorry, I should have read ahead. I think it depends on your definition of canonical (that's going to depend on what protocol you're using to speak to the box and what the box is doing), but yes, there is a way to retrieve one name for a system, which is used for things like shell prompts and syslog messages because those things need a single name. In practice, it has to be a FQDN, but that's due to bad usage by applications, not a POSIX (or SuSv3) requirement. I've not run into many that have this problem. And anything that depends on it to be unique in the whole world is broken. Indeed. Which implies, for instance, that if you're using gethostname to form the LHS of message IDs, you need to be prepared for it to not be unique. That was a much-discussed problem in the USEFOR working group once upon a time. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
OoO Pendant le temps de midi du mercredi 30 décembre 2009, vers 12:03, Gabor Gombas gomb...@sztaki.hu disait : If this is a real question, put: 127.0.1.1 fqdn nodename This seems a very acceptable way to give a FQDN to your laptop without relying on network. hostname -f and programs using a similar inner working will be able to get the right result. Adding meaningless configuration to work around programs that are broken by design does not seem like a good solution. There are a lot of programs requiring some kind of FQDN (for example because they implement a protocol requiring it). How should they get it? I have never seen a more universal that to get node name with uname(), then use gethostbyname(). Please, provide better way. -- MUD IS NOT ONE OF THE 4 FOOD GROUPS MUD IS NOT ONE OF THE 4 FOOD GROUPS MUD IS NOT ONE OF THE 4 FOOD GROUPS -+- Bart Simpson on chalkboard in episode 9F15 pgpNbq2P1eUD7.pgp Description: PGP signature
Re: where is /etc/hosts supposed to come from?
On Wed, Dec 30, 2009 at 03:18:51PM -0200, Henrique de Moraes Holschuh wrote: I prefer to alocate such host names in a real domain, and give them just TXT records or 127.0.1.1 A records in some weird cases where I can't trust the box to not do idiotic things like go to the DNS bypassing the libc resolver. I wouldn't use .local as that seems to be treated as a special case by zeroconf enabled computers, and various OS seem to have zeroconf enabled by default (like it or not). -- Brian May b...@snoopy.debian.net -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Wed, 30 Dec 2009 21:28:52 +0100, Vincent Bernat wrote: OoO Pendant le temps de midi du mercredi 30 décembre 2009, vers 12:03, Gabor Gombas gomb...@sztaki.hu disait : If this is a real question, put: 127.0.1.1 fqdn nodename This seems a very acceptable way to give a FQDN to your laptop without relying on network. hostname -f and programs using a similar inner working will be able to get the right result. Adding meaningless configuration to work around programs that are broken by design does not seem like a good solution. There are a lot of programs requiring some kind of FQDN (for example because they implement a protocol requiring it). How should they get it? I have never seen a more universal that to get node name with uname(), then use gethostbyname(). Please, provide better way. The admin should supply it in the program's configuration, since only the admin is able to know the correct value. -- Sam Morris -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Tue, Dec 29, 2009 at 08:46:09AM +0100, Vincent Bernat wrote: And BTW, this is exactly what hostname -f does. It does not read /etc/hostname. Nothing should read /etc/hostname except /etc/init.d/hostname.sh during boot. Everything else should use either uname(2) or gethostname(3) (which in turn calls uname() internally). For example, on NFSROOT setups /etc/hostname usually does not exist to prevent the host name received from DHCP being overwritten. Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Tue, Dec 29, 2009 at 12:21:45AM +, Sam Morris wrote: What would a hypothetical host that only had IPv6 connectivity do? It's not hypothetical. IPv4 sucks so badly compared to IPv6 that once you switch your internal hosts to v6-only, you don't want to go back. While getting IPv6 connectivity in the first place may be tricky, when you have it, you can forget about all NAT woes, having to run a series of VPNs between locations just to get to hosts inside, and so on. The sooner IPv4 dies, the better. Brain-dead hostname -f remains one of the few annoyances in such a setup. At least in etch, you do need a fake IPv4 stub or it will die messily. It appears that at least this problem has been fixed in unstable, I haven't tested the new version but if it does work, big thanks, guys! We certainly don't have a line analogous to the '127.0.1.1' hack in /etc/ hosts for ipv6, and I'm not even sure what such a line would look like, since ::1 has a /128 netmask. Aye, this needs to be fixed for machines with intermittent connectivity. -- 1KB // Microsoft corollary to Hanlon's razor: // Never attribute to stupidity what can be // adequately explained by malice. -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Dec 29, 2009, at 8:46, Vincent Bernat wrote: OoO En ce doux début de matinée du mardi 29 décembre 2009, vers 08:34, je disais: Details in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099. I do wonder, however, why the system hostname has to appear in /etc/hosts at all? Programs that want to find it out can read /etc/hostname directly, after all. And wtf is 'localdomain' for, anyway? A common way to get hostname is to request node name through uname, then asks for a resolution of this name. If the name does not appear in /etc/hosts, this will lead to a DNS resolution and without network, this can take a long time. And BTW, this is exactly what hostname -f does. It does not read /etc/hostname. On one of my machines apticron uses a call to hostname -f, which fails, while uname -n succeeds. Perhaps it should be a bug to use hostname -f since it unreliable? Jeremiah -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-28 20:56:03 -0800, Steve Langasek wrote: On Tue, Dec 29, 2009 at 01:47:40AM +0100, Vincent Lefevre wrote: As for mail, we already appear to have an /etc/mailname file for MTAs and MUAs to use for finding out the 'canonical' name of the host for message- IDs and the like. /etc/mailname doesn't seem to be specified by POSIX Nope, it's specified in Debian policy (11.6). , so that I doubt that all mail software uses it in practice (Mutt doesn't seem to use it... That would be a bug, then. Not all software is written for Debian. So, why? Even if Debian has its own patches to match its policy, end users are still allowed to compile software from upstream (this is what I do for Mutt, because I have my own patches), and they expect such software to work. So, if the admin of a Debian machine doesn't configure a FQDN (so that the POSIX way to get it doesn't work) just because there's a /etc/mailname already specifying the FQDN, I won't be pleased. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29 14:09:49 +0100, Jeremiah Foster wrote: On one of my machines apticron uses a call to hostname -f, which fails, while uname -n succeeds. uname -n doesn't necessarily return the FQDN. xvii% uname -n xvii xvii% hostname xvii xvii% hostname -f xvii.vinc17.org xvii% cat /etc/hostname xvii Note in the hostname(1) man page: /etc/hostname This file should only contain the hostname and not the full FQDN. Perhaps it should be a bug to use hostname -f since it unreliable? When the machine is correctly configured (i.e. really has a FQDN), hostname -f is reliable. But note that this is Debian-specific. FYI, here's how one can get the FQDN in Perl (gethostbyname is no longer in POSIX, but it currently works in practice... or perhaps hostname has something more reliable?): #!/usr/bin/env perl use strict; use POSIX; my $nodename = (POSIX::uname)[1]; print Nodename: $nodename\n; print FQDN: , (gethostbyname $nodename)[0], \n; (You would do the same thing in other languages: uname, then gethostbyname.) -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Mon, 2009-12-28 at 20:56, Steve Langasek wrote: On Tue, Dec 29, 2009 at 01:47:40AM +0100, Vincent Lefevre wrote: As for mail, we already appear to have an /etc/mailname file for MTAs and MUAs to use for finding out the 'canonical' name of the host for message- IDs and the like. /etc/mailname doesn't seem to be specified by POSIX Nope, it's specified in Debian policy (11.6). , so that I doubt that all mail software uses it in practice (Mutt doesn't seem to use it... That would be a bug, then. Mutt in testing/unstable use /etc/mailname. -- Kind regards, Milan -- Arvanta, IT Securityhttp://www.arvanta.net Please do not send me e-mail containing HTML code. signature.asc Description: Digital signature
Re: where is /etc/hosts supposed to come from?
On Tue, Dec 29, 2009 at 02:52:44PM +0100, Vincent Lefevre wrote: When the machine is correctly configured (i.e. really has a FQDN), hostname -f is reliable. No, it is not. hostname -f can return one value only, while a host may have dozens or hundreds of valid FQDNs. Example: there is a router box called gw which has about a dozen addresses that resolve to gw.domain for just as many domains. Some addresses even share the same NIC. Which FQDN should hostname -f display? Why that one, and not some other? I've submitted a patch for hostname (#562830) to add two new options: one that displays all IP addresses of the host, while the other displays all the FQDNs for those addresses. Neither relies on the value returned by gethostname(), so the hostname must be an FQDN misbelief together with any usage of hostname -f can die a silent death. Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Vincent Lefevre vinc...@vinc17.org writes: Even if Debian has its own patches to match its policy, end users are still allowed to compile software from upstream (this is what I do for Mutt, because I have my own patches), and they expect such software to work. If you expect the software you use to be properly integrated with the Debian system, you should use the Debian packages. That's kind of the whole point of what we're all doing here. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29 18:49:00 +0100, Gabor Gombas wrote: On Tue, Dec 29, 2009 at 02:52:44PM +0100, Vincent Lefevre wrote: When the machine is correctly configured (i.e. really has a FQDN), hostname -f is reliable. No, it is not. hostname -f can return one value only, while a host may have dozens or hundreds of valid FQDNs. Well, the node name is unique. From that, you'll obtain the FQDN with either the obsolete function gethostbyname or the new POSIX function getaddrinfo (by using the AI_CANONNAME flag). POSIX says: If the AI_CANONNAME flag is specified and the nodename argument is not null, the function shall attempt to determine the canonical name corresponding to nodename (for example, if nodename is an alias or shorthand notation for a complete name). And here's what the getaddrinfo(3) man page says under Debian: If hints.ai_flags includes the AI_CANONNAME flag, then the ai_canonname field of the first of the addrinfo structures in the returned list is set to point to the official name of the host. Then you need to configure your machine according to the spec, i.e. you need a single FQDN / canonical name / official name of the host. Example: there is a router box called gw which has about a dozen addresses that resolve to gw.domain for just as many domains. Some addresses even share the same NIC. Which FQDN should hostname -f display? This doesn't really matter. The FQDN may also be another name, i.e. the nodename may be something more meaningful than gw. But host names (like www.debian.org) can also resolve to several IP addresses corresponding to different machines. So, make use that the FQDN doesn't correspond to such a host name. Why that one, and not some other? You should ask this question to those who configured such routers (but this would be more a practical matter, as you may have plenty of choices). I've submitted a patch for hostname (#562830) to add two new options: one that displays all IP addresses of the host, while the other displays all the FQDNs for those addresses. A FQDN is not associated with an IP address, but with a host. You cannot call them FQDN, which already has a well-established meaning. If I understand correctly, you do a reverse DNS lookup. Now, I'm wondering... Can a hostname obtained by reverse DNS lookup resolve to different IP addresses? Neither relies on the value returned by gethostname(), so the hostname must be an FQDN misbelief together with any usage of hostname -f can die a silent death. hostname -f just follows the POSIX notion of canonical name (a.k.a. FQDN). So, I doubt it will die. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29 17:44:31 +0100, Milan P. Stanic wrote: Mutt in testing/unstable use /etc/mailname. But not the official Mutt version. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29 10:45:17 -0800, Russ Allbery wrote: Vincent Lefevre vinc...@vinc17.org writes: Even if Debian has its own patches to match its policy, end users are still allowed to compile software from upstream (this is what I do for Mutt, because I have my own patches), and they expect such software to work. If you expect the software you use to be properly integrated with the Debian system, you should use the Debian packages. That's kind of the whole point of what we're all doing here. When I compile Mutt or any other portable software (e.g. conforming to POSIX), I don't mind if such software isn't integrated with the Debian system. I just want it work according to the POSIX spec. If it doesn't because the system configuration doesn't comply to POSIX, then the system (configuration) is broken. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Vincent Lefevre vinc...@vinc17.org writes: When I compile Mutt or any other portable software (e.g. conforming to POSIX), I don't mind if such software isn't integrated with the Debian system. I just want it work according to the POSIX spec. If it doesn't because the system configuration doesn't comply to POSIX, then the system (configuration) is broken. I don't think POSIX says what you think it says, but I could be wrong. Could you cite the exact section that says that systems are required by POSIX to be configured in the manner that you describe? getaddrinfo does not place such a restriction; AI_CANONNAME is allowed to fail. Note the use of the word attempt and the note: Since different implementations use different conceptual models, the terms ``canonical name'' and ``alias'' cannot be precisely defined for the general case. However, Domain Name System implementations are expected to interpret them as they are used in RFC 1034. I don't believe there's any requirement anywhere in POSIX that the return value of uname -n be registered in DNS. In fact, the POSIX definition of the uname utility specifically says the name of this node within an implementation-defined communications network. Implementation-defined means you cannot depend on it to be anything in particular without additional information about the implementation you're using. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29 14:18:47 -0800, Russ Allbery wrote: Vincent Lefevre vinc...@vinc17.org writes: When I compile Mutt or any other portable software (e.g. conforming to POSIX), I don't mind if such software isn't integrated with the Debian system. I just want it work according to the POSIX spec. If it doesn't because the system configuration doesn't comply to POSIX, then the system (configuration) is broken. I don't think POSIX says what you think it says, but I could be wrong. Could you cite the exact section that says that systems are required by POSIX to be configured in the manner that you describe? I haven't say anything about the configuration, just that POSIX says that a system (locally identified by nodename) has a canonical name. getaddrinfo does not place such a restriction; AI_CANONNAME is allowed to fail. Note the use of the word attempt Yes, but a failure is something one can expect to happen under some occasions, at least for remote hosts. This doesn't mean that hosts don't have a canonical name, just that this canonical name couldn't be determined. For the local host, I would say that a failure is mostly due to a configuration problem (unless a remote DNS is used, in which case it may be down, and BTW, that's why I think it is a bad idea to use one for something purely local). I'd say that making the request fail on purpose is contrary to POSIX, and I find it not surprising that software could fail to behave correctly because of that. and the note: Since different implementations use different conceptual models, the terms ``canonical name'' and ``alias'' cannot be precisely defined for the general case. However, Domain Name System implementations are expected to interpret them as they are used in RFC 1034. I don't believe there's any requirement anywhere in POSIX that the return value of uname -n be registered in DNS. I haven't said that. And this is often not the case under Debian, i.e. the FQDN is often obtained from /etc/hosts, which has the precedence over DNS (see /etc/nsswitch.conf). In fact, the POSIX definition of the uname utility specifically says the name of this node within an implementation-defined communications network. Implementation-defined means you cannot depend on it to be anything in particular without additional information about the implementation you're using. This is implementation-defined, but still, the host has a canonical name, that should be obtainable with getaddrinfo, as described. BTW, Debian defines /etc/mailname as containing the FQDN. So, this notion is explicitly defined on Debian, and one should expect hostname -f to return the same name (according to its documentation). -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Vincent Lefevre vinc...@vinc17.org writes: Yes, but a failure is something one can expect to happen under some occasions, at least for remote hosts. This doesn't mean that hosts don't have a canonical name, just that this canonical name couldn't be determined. For the local host, I would say that a failure is mostly due to a configuration problem (unless a remote DNS is used, in which case it may be down, and BTW, that's why I think it is a bad idea to use one for something purely local). I'd say that making the request fail on purpose is contrary to POSIX, and I find it not surprising that software could fail to behave correctly because of that. I'm having a hard time figuring out what you think the canonical name of my laptop could possibly be, given that it has no static IP address and no DNS entry. In practice, it's whatever arbitrary label that I gave it, and none of these DNS-based resolution techniques are going to do you much good or give you any sort of consistent answer, if they work at all. I haven't said that. And this is often not the case under Debian, i.e. the FQDN is often obtained from /etc/hosts, which has the precedence over DNS (see /etc/nsswitch.conf). I have no entry in /etc/hosts other than 127.0.0.1 and the corresponding IPv6 entries. What could I possibly put in there? This is implementation-defined, but still, the host has a canonical name, that should be obtainable with getaddrinfo, as described. I don't see where you're finding any justification for that should in POSIX. BTW, Debian defines /etc/mailname as containing the FQDN. So, this notion is explicitly defined on Debian, and one should expect hostname -f to return the same name (according to its documentation). No, it's not. You have completely misunderstood the purpose of /etc/mailname. If your package needs to know what hostname to use on (for example) outgoing news and mail messages which are generated locally, you should use the file /etc/mailname. It will contain the portion after the username and @ (at) sign for email addresses of users on the machine (followed by a newline). So on my system, for instance, /etc/mailname is stanford.edu, because that's what goes on the RHS of e-mail addresses. Which, of course, is not the canonical name of my laptop. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
OoO En cette fin de nuit blanche du mercredi 30 décembre 2009, vers 05:23, Russ Allbery r...@debian.org disait : I haven't said that. And this is often not the case under Debian, i.e. the FQDN is often obtained from /etc/hosts, which has the precedence over DNS (see /etc/nsswitch.conf). I have no entry in /etc/hosts other than 127.0.0.1 and the corresponding IPv6 entries. What could I possibly put in there? If this is a real question, put: 127.0.1.1 fqdn nodename This seems a very acceptable way to give a FQDN to your laptop without relying on network. hostname -f and programs using a similar inner working will be able to get the right result. -- I WILL NOT BURP IN CLASS I WILL NOT BURP IN CLASS I WILL NOT BURP IN CLASS -+- Bart Simpson on chalkboard in episode 7G04 pgpikse8ltT4a.pgp Description: PGP signature
Re: where is /etc/hosts supposed to come from?
Vincent Bernat ber...@debian.org writes: Russ Allbery r...@debian.org disait: I haven't said that. And this is often not the case under Debian, i.e. the FQDN is often obtained from /etc/hosts, which has the precedence over DNS (see /etc/nsswitch.conf). I have no entry in /etc/hosts other than 127.0.0.1 and the corresponding IPv6 entries. What could I possibly put in there? If this is a real question, put: 127.0.1.1 fqdn nodename I think we're having some sort of fundamental misunderstanding or communications gap here. What FQDN do you think I should put there? Should I just make something up, like laptop.russ.allbery? In truth, my laptop *does not have an FQDN*. The concept has no useful meaning for a system that is not persistently on any one network, has no native domain, has no DNS entry, and just gets IP addresses via DHCP wherever it happens to be. Nor, as other people have been pointing out, does it have any well-defined meaning for a system that has the opposite problem: multiple separate IP addresses in completely different domains. You seem to have a basic assumption that every given machine can, at the end of the day, be assigned a unique home in DNS that is somehow more legitimate and more correctly defines that system than any other. This is simply not the case in several practical real-world situations. As with a few other people commenting on this thread, I usually shrug and pick an arbitrary one of the DNS names assigned to a multihomed box to be the real name for hostname, since usually it doesn't matter. But I don't think there's anything inherently correct about that, nor do I see anywhere it's required by POSIX. And, for my laptop, there really isn't any such name at all. -- Russ Allbery (r...@debian.org) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Sun, Dec 27, 2009 at 10:38:58PM -0800, John H. Robinson, IV wrote: Brian May wrote: On Mon, Dec 28, 2009 at 03:52:44AM +0100, Marco d'Itri wrote: Considering that any non-trivial server needs to send email out, having a working FQDN configured is not obsolete. I believe mail servers these days generally use /etc/mailname, not hostname -f (although hostname -f might be the default for /etc/mailname). I consider using hostname -f for anything other then the initial default value broken because computers can have multiple network cards, multiple IP addresses, multiple domains, etc. I generally like to assume my computer isn't going to break badly because I have to change the output hostname -f returns. This is one place where Solaris has gotten this right: /etc/nodename refers to the system itself, while each interface has its own (cf: /etc/hostname.hme0). Except /etc/hostname.hme0 doesn't need to contain a hostname, but a set of ifconfig arguments. That the first argument after the interface can be a hostname if it is defined in /etc/hosts is only a (useful) plus. But you can have various other information in /etc/hostname.hme0, such as the IPMP group. Mike -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Sun, Dec 27, 2009 at 10:38:58PM -0800, John H. Robinson, IV wrote: This is one place where Solaris has gotten this right: /etc/nodename refers to the system itself, while each interface has its own (cf: /etc/hostname.hme0). That is still no good for linux since a single interface can have many addresses that all map to different names in the DNS. Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Gabor Gombas wrote: On Sun, Dec 27, 2009 at 10:38:58PM -0800, John H. Robinson, IV wrote: This is one place where Solaris has gotten this right: /etc/nodename refers to the system itself, while each interface has its own (cf: /etc/hostname.hme0). That is still no good for linux since a single interface can have many addresses that all map to different names in the DNS. Hence /etc/hostname.hme0:1 and the like. Already solved. http://www.spitzner.net/interfaces.html -- John H. Robinson, IV jaq...@debian.org http WARNING: I cannot be held responsible for the above, sbih.org ( )(:[ as apparently my cats have learned how to type. spiders.html -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Mon, Dec 28, 2009 at 03:52:44AM +0100, Marco d'Itri wrote: Considering that any non-trivial server needs to send email out, having a working FQDN configured is not obsolete. Anything mail related must use /etc/mailname if it needs something that can be translated to an IP address. Your solution to #562780 is broken anyway, /etc/hostname can (and actually should) be a FQDN. No. /etc/hostname has _nothing_ to do with networking. People historically was lazy to do the proper interface/address enumeration(*) and instead pretended that /etc/hostname is something resolvable, but it is simply not true. It may be made to work in some really simple configurations (read: the host has just a single static IP address), but it cannot work in any serious server configuration having multiple interfaces and every interface having multiple addresses. Anything that uses fqdn -f today should really do the following: L := empty list loop I for all configured interfaces loop P for all supported network protocols loop A for all addresses on I of protocol P append getnameinfo(A) to L remove duplicates from L Gabor (*) mostly because doing this enumeration in a portable way is a PITA -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Mon, Dec 28, 2009 at 12:58:03AM -0800, John H. Robinson, IV wrote: Hence /etc/hostname.hme0:1 and the like. Already solved. # ip addr add eth0 192.168.1.1 # ip addr add eth0 192.168.1.2 # cat /etc/hosts 192.168.1.1 www.foo.com 192.168.1.2 smtp.bar.org Now what /etc/hostname.eth0 should contain? smtp or www? You know, we have that kind of infrastructure already. It's called doing a getnameinfo() on the address returned by getsockname() on the file descriptor returned by accept() - if you do not explicitely bind() to a specific address in the first place. http://www.spitzner.net/interfaces.html Oh yeah, I remember those times. However it is a bit outdated regarding what Linux can do today... Gabor -- - MTA SZTAKI Computer and Automation Research Institute Hungarian Academy of Sciences - -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-28 14:34:39 +1100, Brian May wrote: Also, FQDNs are really not applicable to, say laptops, which frequently change from one network to another. Or some desktops even. I notice on this Ubuntu laptop `hostname` == `hostname -f` perhaps for this reason. FQDNs are also applicable to laptops, as the FQDN can be used to generate the right part of the Message-Id, for instance. Just make sure that it identifies the machine. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-27 14:22:53 -0800, Steve Langasek wrote: No, the hostname should be set on a *separate* line, mapped to 127.0.1.1, as we've been doing for years now. Setting an equivalence between localhost and the hostname causes all manner of problems due to hostname canonicalization. Shouldn't this be described in the hosts(5) man page? -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Mon, Dec 28, 2009 at 08:14:51PM +0100, Vincent Lefevre wrote: On 2009-12-27 14:22:53 -0800, Steve Langasek wrote: No, the hostname should be set on a *separate* line, mapped to 127.0.1.1, as we've been doing for years now. Setting an equivalence between localhost and the hostname causes all manner of problems due to hostname canonicalization. Shouldn't this be described in the hosts(5) man page? That would seem to fit with the rest of the page. I guess a bug report is in order? -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developerhttp://www.debian.org/ slanga...@ubuntu.com vor...@debian.org signature.asc Description: Digital signature
Re: where is /etc/hosts supposed to come from?
On 2009-12-28 12:52:12 -0800, Steve Langasek wrote: That would seem to fit with the rest of the page. I guess a bug report is in order? http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562890 -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Sun, 27 Dec 2009 14:22:53 -0800, Steve Langasek wrote: On Sun, Dec 27, 2009 at 01:25:55PM -0800, Daniel Moerner wrote: On Sun, Dec 27, 2009 at 12:50 PM, Russell Coker russ...@coker.com.au wrote: I've just done a debootstrap install of Lenny, and /etc/hosts doesn't exist. Where is /etc/hosts supposed to come from? I think it should have something like the following (copied from an ancient Debian install). 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts For debootstrapped installs, it's not automatically created by anything. The recommended setup is almost the same as that, although as Neil said you still need to add a hostname on to the first line. No, the hostname should be set on a *separate* line, mapped to 127.0.1.1, as we've been doing for years now. Setting an equivalence between localhost and the hostname causes all manner of problems due to hostname canonicalization. Details in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099. I do wonder, however, why the system hostname has to appear in /etc/hosts at all? Programs that want to find it out can read /etc/hostname directly, after all. And wtf is 'localdomain' for, anyway? -- Sam Morris -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-28 23:41:38 +, Sam Morris wrote: Details in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099. I do wonder, however, why the system hostname has to appear in /etc/hosts at all? Programs that want to find it out can read /etc/hostname directly, after all. And wtf is 'localdomain' for, anyway? Programs may need the FQDN, even without any network connection (for instance, even local mail messages should have a Message-Id). And /etc/hostname doesn't necessarily contain the FQDN. Also, it is required that the FQDN be resolvable (but I wonder whether this is useful in practice). -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Tue, 29 Dec 2009 01:03:12 +0100, Vincent Lefevre wrote: On 2009-12-28 23:41:38 +, Sam Morris wrote: Details in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099. I do wonder, however, why the system hostname has to appear in /etc/hosts at all? Programs that want to find it out can read /etc/hostname directly, after all. And wtf is 'localdomain' for, anyway? Programs may need the FQDN, even without any network connection (for instance, even local mail messages should have a Message-Id). And /etc/hostname doesn't necessarily contain the FQDN. Hm, but shouldn't they use another method to get it? My laptop has no FQDN when it is not connected to a network, and even when it is, it has never, to my knowledge, had a fully qualified name that could be resolved to find out its network address. Conversely, I have used servers that had multiple network interfaces, some of which even have multiple network addresses assigned to them. 'hostname -f' did not yield a sensible result on a couple of these systems. What would a hypothetical host that only had IPv6 connectivity do? We certainly don't have a line analogous to the '127.0.1.1' hack in /etc/ hosts for ipv6, and I'm not even sure what such a line would look like, since ::1 has a /128 netmask. As for mail, we already appear to have an /etc/mailname file for MTAs and MUAs to use for finding out the 'canonical' name of the host for message- IDs and the like. Also, it is required that the FQDN be resolvable (but I wonder whether this is useful in practice). -- Sam Morris -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29 00:21:45 +, Sam Morris wrote: On Tue, 29 Dec 2009 01:03:12 +0100, Vincent Lefevre wrote: Programs may need the FQDN, even without any network connection (for instance, even local mail messages should have a Message-Id). And /etc/hostname doesn't necessarily contain the FQDN. Hm, but shouldn't they use another method to get it? My laptop has no FQDN when it is not connected to a network, and even when it is, it has I think this is bad (POSIX seems to assume that all machines have a FQDN). never, to my knowledge, had a fully qualified name that could be resolved to find out its network address. The goal of the FQDN is not to find its network address (which is rather meaningless, because a network address is related to a network interface, not to the machine). Having the FQDN resolved to 127.0.1.1 on the machine is fine. Conversely, I have used servers that had multiple network interfaces, some of which even have multiple network addresses assigned to them. 'hostname -f' did not yield a sensible result on a couple of these systems. What do you mean by sensible result? I think you're assuming too much concerning hostname -f. What would a hypothetical host that only had IPv6 connectivity do? You still have the IPv4 loopback. We certainly don't have a line analogous to the '127.0.1.1' hack in /etc/ hosts for ipv6, and I'm not even sure what such a line would look like, since ::1 has a /128 netmask. Do you mean that you don't want to use IPv4 at all and that the loopback interface only provides IPv6 addresses? As for mail, we already appear to have an /etc/mailname file for MTAs and MUAs to use for finding out the 'canonical' name of the host for message- IDs and the like. /etc/mailname doesn't seem to be specified by POSIX, so that I doubt that all mail software uses it in practice (Mutt doesn't seem to use it... its way to get the FQDN is currently buggy, but that's another story). -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On 2009-12-29 01:47:40 +0100, Vincent Lefevre wrote: On 2009-12-29 00:21:45 +, Sam Morris wrote: As for mail, we already appear to have an /etc/mailname file for MTAs and MUAs to use for finding out the 'canonical' name of the host for message- IDs and the like. /etc/mailname doesn't seem to be specified by POSIX, so that I doubt that all mail software uses it in practice (Mutt doesn't seem to use it... its way to get the FQDN is currently buggy, but that's another story). BTW, the mailname(5) man page says: The file contains only one line describing the fully qualified ^^^ domain name that the program wishing to get the mail name ^^^ should use (that is, everything after the @). So, that would define the FQDN of your machine, i.e. what hostname -f should return. -- Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/ 100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/ Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
In article 20091229005213.ga28...@xvii.vinc17.org you wrote: So, that would define the FQDN of your machine, i.e. what hostname -f should return. We can also thing about putting the fully qualified host name in /etc/hostname. A patch to hostname would be to not start resolving, if /uname contains a dot. Greetings Bernd -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Tue, Dec 29, 2009 at 01:47:40AM +0100, Vincent Lefevre wrote: As for mail, we already appear to have an /etc/mailname file for MTAs and MUAs to use for finding out the 'canonical' name of the host for message- IDs and the like. /etc/mailname doesn't seem to be specified by POSIX Nope, it's specified in Debian policy (11.6). , so that I doubt that all mail software uses it in practice (Mutt doesn't seem to use it... That would be a bug, then. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developerhttp://www.debian.org/ slanga...@ubuntu.com vor...@debian.org signature.asc Description: Digital signature
Re: where is /etc/hosts supposed to come from?
OoO En cette nuit nuageuse du mardi 29 décembre 2009, vers 00:41, Sam Morris s...@robots.org.uk disait : Details in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099. I do wonder, however, why the system hostname has to appear in /etc/hosts at all? Programs that want to find it out can read /etc/hostname directly, after all. And wtf is 'localdomain' for, anyway? A common way to get hostname is to request node name through uname, then asks for a resolution of this name. If the name does not appear in /etc/hosts, this will lead to a DNS resolution and without network, this can take a long time. -- panic(kmem_cache_init(): Offsets are wrong - I've been messed with!); 2.2.16 /usr/src/linux/mm/slab.c pgpoaQHfiLk8y.pgp Description: PGP signature
Re: where is /etc/hosts supposed to come from?
OoO En ce doux début de matinée du mardi 29 décembre 2009, vers 08:34, je disais: Details in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099. I do wonder, however, why the system hostname has to appear in /etc/hosts at all? Programs that want to find it out can read /etc/hostname directly, after all. And wtf is 'localdomain' for, anyway? A common way to get hostname is to request node name through uname, then asks for a resolution of this name. If the name does not appear in /etc/hosts, this will lead to a DNS resolution and without network, this can take a long time. And BTW, this is exactly what hostname -f does. It does not read /etc/hostname. -- BOFH excuse #96: Vendor no longer supports the product pgp9CwnzoThWh.pgp Description: PGP signature
Re: where is /etc/hosts supposed to come from?
On Mon, 28 Dec 2009 07:50:10 +1100 Russell Coker russ...@coker.com.au wrote: I've just done a debootstrap install of Lenny, and /etc/hosts doesn't exist. Where is /etc/hosts supposed to come from? Depending on the purpose of running debootstrap, it's either copied from the external system or generated by the installation process. Something like pbuilder copies the external /etc/hosts into the chroot. I think it should have something like the following (copied from an ancient Debian install). 127.0.0.1 localhost Various tools need 'hostname -f' to operate, so there will need to be more in /etc/hosts than that - which is where things can get complex. A hostname of some kind is going to be needed. Not sure if that would suit D-I -- Neil Williams = http://www.data-freedom.org/ http://www.linux.codehelp.co.uk/ http://e-mail.is-not-s.ms/ pgpNkoevYRSQ8.pgp Description: PGP signature
Re: where is /etc/hosts supposed to come from?
Hi, On Sun, Dec 27, 2009 at 12:50 PM, Russell Coker russ...@coker.com.au wrote: I've just done a debootstrap install of Lenny, and /etc/hosts doesn't exist. Where is /etc/hosts supposed to come from? I think it should have something like the following (copied from an ancient Debian install). 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts For debootstrapped installs, it's not automatically created by anything. The recommended setup is almost the same as that, although as Neil said you still need to add a hostname on to the first line. See section D.3.4.4 of the installation manual. [1] [1] http://www.debian.org/releases/stable/amd64/apds03.html.en#id3124776 Daniel -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Sun, Dec 27, 2009 at 01:25:55PM -0800, Daniel Moerner wrote: On Sun, Dec 27, 2009 at 12:50 PM, Russell Coker russ...@coker.com.au wrote: I've just done a debootstrap install of Lenny, and /etc/hosts doesn't exist. Where is /etc/hosts supposed to come from? I think it should have something like the following (copied from an ancient Debian install). 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts For debootstrapped installs, it's not automatically created by anything. The recommended setup is almost the same as that, although as Neil said you still need to add a hostname on to the first line. No, the hostname should be set on a *separate* line, mapped to 127.0.1.1, as we've been doing for years now. Setting an equivalence between localhost and the hostname causes all manner of problems due to hostname canonicalization. [1] http://www.debian.org/releases/stable/amd64/apds03.html.en#id3124776 Well, ugh, that needs corrected. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developerhttp://www.debian.org/ slanga...@ubuntu.com vor...@debian.org signature.asc Description: Digital signature
Re: where is /etc/hosts supposed to come from?
On Mon, 28 Dec 2009, Neil Williams codeh...@debian.org wrote: Various tools need 'hostname -f' to operate, so there will need to be more in /etc/hosts than that - which is where things can get complex. A hostname of some kind is going to be needed. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562780 I've filed a bug against Dovecot regarding this issue. There should be very few tools that rely on hostname -f working - or returning useful data if it does work. In the modern Internet where services such as EC2 are increasing in popularity in the vast majority of cases the purpose of a hostname is only for tracking errors. It's used in syslog and displayed to the users in some situations (such as Perdition connection messages and email headers) so that users can make useful problem reports. In those cases the FQDN is of no use, a client who reads their mail in the example.com domain and wants to report a problem doesn't need to know that it's server10.example.com that had a problem, the server being described as merely server10 should be adequate. One annoying aspect of this is that /etc/hosts can't be the same on all systems. It means that I need to make my distribution process involve adding an extra customised line after pushing a change of /etc/hosts to all servers. While this isn't THAT painful, it's something that can get messed up on occasion. -- russ...@coker.com.au http://etbe.coker.com.au/ My Main Blog http://doc.coker.com.au/ My Documents Blog -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
On Dec 28, Russell Coker russ...@coker.com.au wrote: In the modern Internet where services such as EC2 are increasing in popularity in the vast majority of cases the purpose of a hostname is only for tracking errors. If you are too lazy to have a script properly configure your servers it does not mean that the programs which rely on a properly configured server to work are broken. Considering that any non-trivial server needs to send email out, having a working FQDN configured is not obsolete. Your solution to #562780 is broken anyway, /etc/hostname can (and actually should) be a FQDN. -- ciao, Marco signature.asc Description: Digital signature
Re: where is /etc/hosts supposed to come from?
On Mon, Dec 28, 2009 at 03:52:44AM +0100, Marco d'Itri wrote: Considering that any non-trivial server needs to send email out, having a working FQDN configured is not obsolete. I believe mail servers these days generally use /etc/mailname, not hostname -f (although hostname -f might be the default for /etc/mailname). I consider using hostname -f for anything other then the initial default value broken because computers can have multiple network cards, multiple IP addresses, multiple domains, etc. I generally like to assume my computer isn't going to break badly because I have to change the output hostname -f returns. Also, FQDNs are really not applicable to, say laptops, which frequently change from one network to another. Or some desktops even. I notice on this Ubuntu laptop `hostname` == `hostname -f` perhaps for this reason. -- Brian May b...@snoopy.debian.net -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: where is /etc/hosts supposed to come from?
Brian May wrote: On Mon, Dec 28, 2009 at 03:52:44AM +0100, Marco d'Itri wrote: Considering that any non-trivial server needs to send email out, having a working FQDN configured is not obsolete. I believe mail servers these days generally use /etc/mailname, not hostname -f (although hostname -f might be the default for /etc/mailname). I consider using hostname -f for anything other then the initial default value broken because computers can have multiple network cards, multiple IP addresses, multiple domains, etc. I generally like to assume my computer isn't going to break badly because I have to change the output hostname -f returns. This is one place where Solaris has gotten this right: /etc/nodename refers to the system itself, while each interface has its own (cf: /etc/hostname.hme0). -- John H. Robinson, IV jaq...@debian.org http WARNING: I cannot be held responsible for the above, sbih.org ( )(:[ as apparently my cats have learned how to type. spiders.html -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org