# Unix/Linux command to get all domain names under one IP



## tonyg (Dec 23, 2013)

I have searched high and low and found only websites that will list out all domains resolving to one IP.

However, I have failed to find a command or set of commands using whois, host, dig etc. to give me that info.

Anyone have any insight into this?

Again, I don't want a website link...I am looking for a script or one liner for *nix.

Tony


----------



## mojeda (Dec 23, 2013)

Install bind9-host


```
host domain.tld
```


```
:~# host google.com
google.com has address 74.125.21.139
google.com has address 74.125.21.113
google.com has address 74.125.21.102
google.com has address 74.125.21.100
google.com has address 74.125.21.138
google.com has address 74.125.21.101
```


----------



## WebSearchingPro (Dec 23, 2013)

@mojeda

I think he wants the opposite, you put in an IP and get a list of domains hosted on that IP.


----------



## tonyg (Dec 23, 2013)

WebSearchingPro is correct...I want to input an IP address and see all the domain names that are being hosted under that one IP.


----------



## telephone (Dec 23, 2013)

There are none. The websites that list this data do so by archiving WHOIS/DNS information.

Here's your best option:


Download the top one million sites from Alexa (updated daily): Top 1,000,000

Perform mass DNS queries and store data in a database
Check each IP is active and DNS doesn't point to a dead IP
Use SQL statements to return all domains associated with IP
Alternative:


Get access to zone file dumps (Verisign, ICANN, ARIN (bulk whois), or from someone who sells the data PremiumDrops)
Do the same as above with mass queries and analyzing data

^ You'll have to create a scraper, poll (spam) millions of records, analyze/correlate data, and worry about stale data. ENJOY!


----------



## mojeda (Dec 23, 2013)

Aaaahhh here you go: http://www.yougetsignal.com/tools/web-sites-on-web-server/

Not command line but nonetheless...


----------



## tonyg (Dec 23, 2013)

@telephone...thanks good info!

@mojeda...I am well aware of sites that provide this info. Thanks anyways.


----------



## wlanboy (Dec 29, 2013)

Wasn't there a website that allready scraped the whole google dns servers?

Would be fun to how the domains are allocated through the different subnets.


----------



## HalfEatenPie (Dec 29, 2013)

I know whois.sc does something like this but you need a pro account in order to get the results.


----------



## scv (Dec 30, 2013)

There is no 100% reliable utility to do this.


----------



## xmob (Jan 1, 2014)

Probably the only good feature of Bing.  Do a search like thus:

IP:<ip address>

It's not perfect, but a good stab at it.


----------

