Operating System - HP-UX
1833871 Members
1737 Online
110063 Solutions
New Discussion

what command to see alias names of a Unix m/c

 
ezhilarasan_1
Occasional Advisor

what command to see alias names of a Unix m/c


Hi,

what command to see alias names of a Unix m/c

we login to m/c using one name.
But hostname command shows different
To make sure both are same m/c, we want to see
alias names for a machine.

Thanks
Ezhil

3 REPLIES 3
Bharat Katkar
Honored Contributor

Re: what command to see alias names of a Unix m/c

Hi Ezhil,
To see what alias names you have for your system look at /etc/hosts file.

# cd /etc
# more hosts

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Sยภเl Kย๓คг
Respected Contributor

Re: what command to see alias names of a Unix m/c

Hi ezhil
/etc/hosts file contains the host name and it's aliases.U can refere /etc/hosts file to view the hosts alises.
1.use cat /etc/hosts to view host alias
2.The uname -a command will show u the actaual host name.

regards
SK
sunilhcl@rediffmail.com
Your imagination is the preview of your life's coming attractions
Sanjay_6
Honored Contributor

Re: what command to see alias names of a Unix m/c

Hi,

If you are using DNS for the name resolution, you can try nslookup to see if any alias is set for that host,

nslookup ip_add_of_the_host
nslookup host_name

But instead of an alias, the dns name that you are using could be a floating ip. It is not always to find all the aliases for a certain ip /host unless you have access to the DNS server.

Hope this helps.

Regds