cli
cli copied to clipboard
Add support for domain names in bulk command
I added support for bulk ip info requests using domain names. The CLI now attempts to solve the ip of a domain even in bulk mode. It does this just like the domain command.
Example
PS C:\Users\Eduardo\Desktop\cli\ipinfo> .\ipinfo.exe bulk 1.1.1.1 8.8.8.8 github.com ipinfo.io
{
"1.1.1.1": {
"ip": "1.1.1.1",
"hostname": "one.one.one.one",
"anycast": true,
"city": "Miami",
"region": "Florida",
"country": "US",
"country_name": "United States",
"loc": "25.7867,-80.1800",
"org": "AS13335 Cloudflare, Inc.",
"postal": "33132",
"timezone": "America/New_York"
},
"140.82.112.4": {
"ip": "140.82.112.4",
"hostname": "lb-140-82-112-4-iad.github.com",
"city": "Washington",
"region": "Washington, D.C.",
"country": "US",
"country_name": "United States",
"loc": "38.8951,-77.0364",
"org": "AS36459 GitHub, Inc.",
"postal": "20004",
"timezone": "America/New_York"
},
"34.117.59.81": {
"ip": "34.117.59.81",
"hostname": "81.59.117.34.bc.googleusercontent.com",
"anycast": true,
"city": "Mountain View",
"region": "California",
"country": "US",
"country_name": "United States",
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles"
},
"8.8.8.8": {
"ip": "8.8.8.8",
"hostname": "dns.google",
"anycast": true,
"city": "Mountain View",
"region": "California",
"country": "US",
"country_name": "United States",
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles"
}
}
You may also use domain names in files. Example:
PS C:\Users\Eduardo\Desktop\cli\ipinfo> .\ipinfo.exe bulk 1.1.1.1 c:\Users\Eduardo\Desktop\ips.txt
{
"1.1.1.1": {
"ip": "1.1.1.1",
"hostname": "one.one.one.one",
"anycast": true,
"city": "Miami",
"region": "Florida",
"country": "US",
"country_name": "United States",
"loc": "25.7867,-80.1800",
"org": "AS13335 Cloudflare, Inc.",
"postal": "33132",
"timezone": "America/New_York"
},
"1.2.3.4": {
"ip": "1.2.3.4",
"city": "Chakwal",
"region": "Punjab",
"country": "PK",
"country_name": "Pakistan",
"loc": "32.8600,72.9427",
"postal": "48500",
"timezone": "Asia/Karachi"
},
"140.82.113.3": {
"ip": "140.82.113.3",
"hostname": "lb-140-82-113-3-iad.github.com",
"city": "Washington",
"region": "Washington, D.C.",
"country": "US",
"country_name": "United States",
"loc": "38.8951,-77.0364",
"org": "AS36459 GitHub, Inc.",
"postal": "20004",
"timezone": "America/New_York"
},
"151.101.1.21": {
"ip": "151.101.1.21",
"anycast": true,
"city": "San Francisco",
"region": "California",
"country": "US",
"country_name": "United States",
"loc": "37.7621,-122.3971",
"org": "AS54113 Fastly",
"postal": "94107",
"timezone": "America/Los_Angeles"
},
"192.168.1.254": {
"ip": "192.168.1.254",
"bogon": true
},
"23.210.158.132": {
"ip": "23.210.158.132",
"hostname": "a23-210-158-132.deploy.static.akamaitechnologies.com",
"city": "Miami",
"region": "Florida",
"country": "US",
"country_name": "United States",
"loc": "25.7743,-80.1937",
"org": "AS16625 Akamai Technologies, Inc.",
"postal": "33101",
"timezone": "America/New_York"
},
"2607:f8b0:4008:809::200e": {
"ip": "2607:f8b0:4008:809::200e",
"city": "Miami",
"region": "Florida",
"country": "US",
"country_name": "United States",
"loc": "25.7743,-80.1937",
"org": "AS15169 Google LLC",
"postal": "33101",
"timezone": "America/New_York"
},
"8.8.8.8": {
"ip": "8.8.8.8",
"hostname": "dns.google",
"anycast": true,
"city": "Mountain View",
"region": "California",
"country": "US",
"country_name": "United States",
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles"
}
}
ips.txt:
8.8.8.8
github.com
1.2.3.4
www.americanexpress.com
www.paypal.com
192.168.1.254
www.youtube.com
Thanks for the contrib @eacp ! I'll try to take a look at this this week.
It would make a lot of sense to do something like this if the API supported looking up the IPs for domains on its own, but it doesn't, so the current model will cause serious speed issues if even just a handful of domains are sprinkled around the list sent to bulk.