Hide Forgot
Description of problem: man hostname for RHEL6.7 says: Technically: The FQDN is the name gethostbyname(2) returns for the host name returned by gethostname(2). The DNS domain name is the part after the first dot. This does not make sense so I checked in Fedora 22 and it says: Technically: The FQDN is the name getaddrinfo(3) returns for the host name returned by gethostname(2). The DNS domain name is the part after the first dot. Can you please check and update man page. Version-Release number of selected component (if applicable): [root@RHEL6-7-WS ~]# hostname -V net-tools 1.60 hostname 1.100 (2001-04-14) A review of other differences in the RHEL6.7 vs. Fedora hostname man page would be a welcome bonus. Thank you
In RHEL6.7 hostname man page: The difference in gethostname(2) and gethostbyname(3) is that gethost- byname(3) is network aware, so it consults /etc/nsswitch.conf and /etc/host.conf to decide whether to read information in /etc/sysconfig/network or /etc/hosts Is /etc/hostname missing from that list? or does gethostbyname(3 not read /etc/hostname ? Thank you
(In reply to Stephen Wadeley from comment #0) > man hostname for RHEL6.7 says: > > Technically: The FQDN is the name gethostbyname(2) returns for the host name > returned by gethostname(2). The DNS domain name is the part after the first dot. Just to be sure: have you noticed that gethostbyname(2) and gethostname(2) are different functions ? It basically first calls gethostname() and then calls gethostbyname() on the result of the first one. gethostname() = get hostname gethostbyname() = get more info about a hostname > This does not make sense so I checked in Fedora 22 and it says: > > Technically: The FQDN is the name getaddrinfo(3) returns for the host > name returned by gethostname(2). The DNS domain name is the part after the > first dot. Here getaddrinfo() is just a successor of gethostbyname().
(In reply to Jiri Popelka from comment #3) > (In reply to Stephen Wadeley from comment #0) > > man hostname for RHEL6.7 says: > > > > Technically: The FQDN is the name gethostbyname(2) returns for the host name > returned by gethostname(2). The DNS domain name is the part after the first dot. > > Just to be sure: have you noticed that gethostbyname(2) and gethostname(2) > are different functions ? Oh, no, sorry! I was reading too many man pages at once I think (in RHEL6 VM and Fedora host). > > It basically first calls gethostname() and then calls gethostbyname() on the > result of the first one. > gethostname() = get hostname > gethostbyname() = get more info about a hostname > > > This does not make sense so I checked in Fedora 22 and it says: > > > > Technically: The FQDN is the name getaddrinfo(3) returns for the host > > name returned by gethostname(2). The DNS domain name is the part after the > > first dot. > > Here getaddrinfo() is just a successor of gethostbyname(). Thank you
(In reply to Stephen Wadeley from comment #1) > In RHEL6.7 hostname man page: > > The difference in gethostname(2) and gethostbyname(3) is that gethost- > byname(3) is network aware, so it consults /etc/nsswitch.conf > and > /etc/host.conf to decide whether to read information > in > /etc/sysconfig/network or /etc/hosts > > Is /etc/hostname missing from that list? or does gethostbyname(3 not read > /etc/hostname ? > after checking I see there is no /etc/hostname file in RHEL6.7 by default. So, we can close this as NOTABUG I think.