Link to home
Start Free TrialLog in
Avatar of mansur_mca
mansur_mcaFlag for United Arab Emirates

asked on

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

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
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mansur_mca

ASKER

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
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
Avatar of mikemsd
mikemsd

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