Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Command for Host Name to IP Address or Vice Versa

UNIX for Dummies Questions & Answers


 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-16-2013
nag_sathi nag_sathi is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 2 May 2016, 6:06 AM EDT
Location: INDIA
Posts: 64
Thanks: 47
Thanked 2 Times in 2 Posts
Command for Host Name to IP Address or Vice Versa

Hi,

In unix or linux is there any command exist to identify Host Name to IP Address or Vice Versa?

Thanks in advance
Sponsored Links
    #2  
Old Unix and Linux 01-16-2013
Scott's Unix or Linux Image
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 24 August 2016, 1:39 AM EDT
Location: Zürich
Posts: 8,595
Thanks: 342
Thanked 1,092 Times in 948 Posts
nslookup?
The Following User Says Thank You to Scott For This Useful Post:
nag_sathi (01-16-2013)
Sponsored Links
    #3  
Old Unix and Linux 01-16-2013
nag_sathi nag_sathi is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 2 May 2016, 6:06 AM EDT
Location: INDIA
Posts: 64
Thanks: 47
Thanked 2 Times in 2 Posts
Hi Scott,

Thanks for the reply.

However can i get url name or domain name from IP using nslookup.

For example can i get the url name wwwdotgoogledotcom from IP.
    #4  
Old Unix and Linux 01-16-2013
Scott's Unix or Linux Image
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 24 August 2016, 1:39 AM EDT
Location: Zürich
Posts: 8,595
Thanks: 342
Thanked 1,092 Times in 948 Posts
You can get the IP address of a domain, yes.


Code:
# nslookup bbc.co.uk
Server: xxx.xxx.xxx.xxx
Address: xxx.xxx.xxx.xxx
Non-authoritative answer:
Name: bbc.co.uk
Address: 212.58.241.131

ping will also give the IP address, and in many impementations the domain name.
The Following User Says Thank You to Scott For This Useful Post:
nag_sathi (01-16-2013)
Sponsored Links
    #5  
Old Unix and Linux 01-16-2013
nag_sathi nag_sathi is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 2 May 2016, 6:06 AM EDT
Location: INDIA
Posts: 64
Thanks: 47
Thanked 2 Times in 2 Posts
Hi Scott,

Thanks, just check in server its working.

in addition to above query,Is there any command to get hostname from IP.
Sponsored Links
    #6  
Old Unix and Linux 01-16-2013
Vikram_Tanwar12 Vikram_Tanwar12 is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 21 November 2013, 3:32 AM EST
Posts: 168
Thanks: 13
Thanked 10 Times in 10 Posts
You can also use
Code:
Host

Command.


Code:
host hostname

Similarly vice-versa.
Sponsored Links
    #7  
Old Unix and Linux 01-16-2013
Scott's Unix or Linux Image
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 24 August 2016, 1:39 AM EDT
Location: Zürich
Posts: 8,595
Thanks: 342
Thanked 1,092 Times in 948 Posts
Very little is working for me (including host) since I'm currently behind a corporate firewall (and that's probably good!), but dig can also be used to do a reverse lookup from an IP address.
Sponsored Links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with scp from one server to the other (but not vice versa) mrrossi UNIX for Dummies Questions & Answers 2 01-12-2012 07:27 AM
Windows network share visible to Solaris 9 host and vice versa jamba1 Solaris 1 05-24-2011 03:06 AM
Uppercase to lowercase and vice versa jacky29 Shell Programming and Scripting 5 03-28-2011 04:33 AM
binary to string conversion and vice versa kinnaree Programming 3 11-16-2002 08:02 AM
QNX host cannot ping SCO host, vice versa gavon IP Networking 2 08-20-2001 08:57 PM



All times are GMT -4. The time now is 06:25 AM.