LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-20-2015, 10:08 PM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
How to get domain name from ip address with some command?


ping baidu.com
PING baidu.com (123.125.114.144) 56(84) bytes of data.
64 bytes from 123.125.114.144: icmp_seq=1 ttl=54 time=85.4 ms

I got the ip linked to the domain name.

How to get domain name from 123.125.114.144 address with some command?
It is obvious to input 123.125.114.144 in my browser to get domain name,but it is not a command.
 
Old 12-20-2015, 11:21 PM   #2
Steven_G
Member
 
Registered: Dec 2015
Location: Western US
Distribution: Home spun
Posts: 142

Rep: Reputation: 67
IDK where you got that IP? When I ping baidu by name I get 180.149.132.47. Other tools (below) reveal more info. But none return 123.125.114.144.

When I ping 123.125.114.144 on a 5 count it returns once and drops and it won't resolve when I run ip to name inquires on it.

But to answer you question all of the following work forward and reverse, i.e. IP<->DNS (as long as you're not having DNS issues):

host
ping
nslookup
dig
traceroute
whois

Last edited by Steven_G; 12-20-2015 at 11:25 PM.
 
Old 12-20-2015, 11:50 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,249
Blog Entries: 24

Rep: Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190
You cannot always resolve an IP address back to a domain name. It depends on whether the owner has configured a reverse lookup for the IP.

Sometimes the best you can hope for is to find who owns the address block which includes the IP address.

In repeated lookups of baidu.com, including ping requests, I have received 4 different IP addresses, including 123.125.114.144 - none of which result in baidu.com by reverse lookup.

Also, there is very often not a single domain served by a single IP address - think shared hosting services. So the only possible reverse lookup is the owner of the address block. In the case of 123.125.114.144, I show 629 websites (domains) served by that IP address...

Code:
IP Location 	China China Beijing Sgghn
ASN 	China AS4808 CHINA169-BJ CNCGROUP IP network China169 Beijing 
Province Network (registered Jan 09, 1996)
Whois Server 	whois.apnic.net
IP Address 	123.125.114.144
Reverse IP 	629 websites use this address.

Last edited by astrogeek; 12-21-2015 at 12:02 AM.
 
1 members found this post helpful.
Old 12-21-2015, 12:13 AM   #4
Steven_G
Member
 
Registered: Dec 2015
Location: Western US
Distribution: Home spun
Posts: 142

Rep: Reputation: 67
Yeah, I finally found 123.125.114.144 by pinging the name, But I actually had to run the inquiry 17x in a row before I got that result instead of 4.

Must be the dif in geolocations, providers, edges, BGPs, trunks, yadda, yadda, yadda.
 
Old 12-21-2015, 12:18 AM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,249
Blog Entries: 24

Rep: Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190
I think that Baidu's nameservers do a bit of load balancing as well by distributing requests across different physical addresses. There can be a variety of reasons for getting different responses. All of which make reverse DNS return unexpected results.
 
Old 12-21-2015, 10:20 AM   #6
Steven_G
Member
 
Registered: Dec 2015
Location: Western US
Distribution: Home spun
Posts: 142

Rep: Reputation: 67
Well, if I was looking for myself, instead of just answering a question: I wouldn't dink around with one CLI tool at a time by hand anyway. I'd just run an automated passive scan against it and pick up all of its published info.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Forward domain emails to another domain and address szboardstretcher Linux - Server 3 05-19-2014 01:58 PM
Domain name to IP address hari921019 Linux - Newbie 6 03-09-2014 09:19 AM
new qmail install changes from address to domain@domain mrshiat Linux - General 1 12-19-2012 11:35 AM
Command to know the stub domain ip address in ip4 format cola Slackware 7 04-10-2010 09:19 AM
Domain Name and IP Address EviLBoX Linux - Networking 5 11-15-2007 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration