LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-03-2017, 07:16 PM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
output of hostname -A


`hostname -A` displays all FQDNs of the machine, according to the manual of `hostname`.

Here is my PC in local home net.

debian8@hwy:~$ hostname -A
hwy
debian8@hwy:~$ hostname -d
local
debian8@hwy:~$ hostname -f
hwy.local

Why is the output info of `hostname -A` not `hwy.local`?
-A, --all-fqdns Displays,but hwy is not fqdn at all!!
 
Old 03-03-2017, 09:13 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,092
Blog Entries: 28

Rep: Reputation: 6088Reputation: 6088Reputation: 6088Reputation: 6088Reputation: 6088Reputation: 6088Reputation: 6088Reputation: 6088Reputation: 6088Reputation: 6088Reputation: 6088
I get this on Slackware --Current.

Code:
$ hostname -A
hostname: invalid option -- 'A'
$ hostname --version
net-tools 1.60
hostname 1.100 (2001-04-14
What distro/version are you using and what version of hostname is installed?

By the way, hostname has been around for a long time. It's highly unlikely that you will get an answer to your "why" question that's other than some variation on "because they wrote it that way." In writing programs, sometimes authors must make arbitrary decisions that make sense to them, but the reasons for the decisions are not readily apparent to others.

Last edited by frankbell; 03-03-2017 at 09:25 PM.
 
Old 03-04-2017, 06:43 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052
Code:
$> hostname -A
hostname: invalid option -- 'A'
Try 'hostname --help' or 'hostname --usage' for more information.
$> hostname --version
hostname (GNU inetutils) 1.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
that's from my archlinux system, but my debian system has the -A option.
it returns an empty string.
which is strange, because 'hostname -fqdn' returns 'localhost'.

Last edited by ondoho; 03-04-2017 at 06:48 AM.
 
Old 03-04-2017, 07:32 PM   #4
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Original Poster
Rep: Reputation: Disabled
cat /etc/issue.net
Debian GNU/Linux 8
hostname -V
hostname 3.15
 
Old 03-07-2017, 02:28 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052Reputation: 6052
Quote:
Originally Posted by ondoho View Post
Code:
$> hostname -A
hostname: invalid option -- 'A'
Try 'hostname --help' or 'hostname --usage' for more information.
$> hostname --version
hostname (GNU inetutils) 1.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
that's from my archlinux system, but my debian system has the -A option.
it returns an empty string.
which is strange, because 'hostname -fqdn' returns 'localhost'.
i forgot to mention what -A is supposed to do:
Code:
       -A, --all-fqdns
              Displays all FQDNs of the machine. This option enumerates all  configured
              network  addresses  on  all configured network interfaces, and translates
              them to DNS domain names.  Addresses  that  cannot  be  translated  (i.e.
              because  they  do  not have an appropriate reverse IP entry) are skipped.
              Note that different addresses may resolve to the same name, therefore the
              output  may  contain duplicate entries. Do not make any assumptions about
              the order of the output.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HOSTNAME = hostname -> HOSTNAME: command not found ? thomas2004ch Linux - Software 2 08-26-2013 09:25 PM
getting errors related to hostname -- security problem? ok to change hostname? sneakyimp Linux - Server 2 11-18-2012 06:25 PM
clients CAN resolve hostname of server w/nslookup, but CANNOT access by hostname WTF? psycroptic Linux - Networking 9 11-10-2012 12:24 PM
Changed hostname during install, now CUPS has wrong hostname on web interface slinx Linux - Software 1 08-07-2009 09:01 PM
after hostname change, syslogd still output previous hostname to messages file tiger2000 Linux - General 3 07-22-2009 10:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration