RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1308470 - hostname man page is not clear on FQDN and needs review
Summary: hostname man page is not clear on FQDN and needs review
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-tools
Version: 6.7
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Jiri Popelka
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-15 10:00 UTC by Stephen Wadeley
Modified: 2016-02-15 12:19 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-15 12:19:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Stephen Wadeley 2016-02-15 10:00:21 UTC
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

Comment 1 Stephen Wadeley 2016-02-15 10:02:38 UTC
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

Comment 3 Jiri Popelka 2016-02-15 11:06:43 UTC
(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().

Comment 4 Stephen Wadeley 2016-02-15 12:13:33 UTC
(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

Comment 5 Stephen Wadeley 2016-02-15 12:17:47 UTC
(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.


Note You need to log in before you can comment on or make changes to this bug.