Command for Host Name to IP Address or Vice Versa | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Command for Host Name to IP Address or Vice Versa

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-16-2013
nag_sathi nag_sathi is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 19 February 2014, 9:55 AM EST
Location: INDIA
Posts: 60
Thanks: 43
Thanked 1 Time in 1 Post
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 01-16-2013
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 24 April 2014, 10:21 PM EDT
Location: in der Schweiz
Posts: 8,323
Thanks: 313
Thanked 1,013 Times in 886 Posts
nslookup?
The Following User Says Thank You to Scott For This Useful Post:
nag_sathi (01-16-2013)
Sponsored Links
    #3  
Old 01-16-2013
nag_sathi nag_sathi is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 19 February 2014, 9:55 AM EST
Location: INDIA
Posts: 60
Thanks: 43
Thanked 1 Time in 1 Post
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 01-16-2013
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 24 April 2014, 10:21 PM EDT
Location: in der Schweiz
Posts: 8,323
Thanks: 313
Thanked 1,013 Times in 886 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 01-16-2013
nag_sathi nag_sathi is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 19 February 2014, 9:55 AM EST
Location: INDIA
Posts: 60
Thanks: 43
Thanked 1 Time in 1 Post
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 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 01-16-2013
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 24 April 2014, 10:21 PM EDT
Location: in der Schweiz
Posts: 8,323
Thanks: 313
Thanked 1,013 Times in 886 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
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:15 AM.