Solved

how to know hostname , If we have IP address in Unix OS

Posted on 2007-11-24
5
3,534 Views
Last Modified: 2013-12-16
Dear experts ,

In the unix operations system, if the we have ipaddress of the machine how to know the host name of that machine

thanks for your efforts in advance answering for this  questions
0
Comment
Question by:mansur_mca
  • 2
  • 2
5 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 100 total points
ID: 20343026
Hi,

run the command

ifconfig -a

This command will list the interfaces on the system with info about its ip addresses, etc.

Also, you can look in /etc/hosts where the server name along its ip address is added.

0
 
LVL 2

Assisted Solution

by:mikemsd
mikemsd earned 25 total points
ID: 20343065
Also, depending on your distribution, you can run the command:

hostname

from the command prompt, and it will return your hostname.
0
 
LVL 1

Author Comment

by:mansur_mca
ID: 20343089
Happy to see you omarfarid  you reacted so soon.

I mean to say  , If we have hostname of server ,  can easily able to  find IP by the just ping request to Host name , My  requirement is other way round ( Ip address to hostname).
Consider I am  simple user in domain network , not as admin .
thanks ...to u
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20343131
Hi,

Mansur:

When you ping a hostname / servername then the resolution is either done from /etc/hosts or dns.

This depends on configuration of

- /etc/resolv.conf
- /etc/nsswitch.conf

Now, for the mapping of ip address to hostname / server name, then you either get it from /etc/hosts

or from dns if that ip address is configured on reverse lookup domain.

If you have a dns server and the reverse lookup of a range of ips is delegated to that server, then you can configure it to do so.

The reverse lookup of ips is under the domain in-addr.arpa

e.g. if you have a network 192.168.1 then the reverse lookup for it will be under the domain 1.168.192.in-addr.arpa
0
 
LVL 2

Expert Comment

by:mikemsd
ID: 20343133
Again, depending on distribution and tools installed, to do a reverse lookup of an IP address, perform either:

nslookup <ip address>

or

dig -x <ip address> +short
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question