Comments (19)
Some sort of warning could be displayed if neccesary.
I recommended:
we should add a disclaimer in the subcommand description
from cli.
@UmanShahzad IMHO, it would be more intuitive if the CLI replicated the behaviour of ping and traceroute: use the ip as given by the user, and IF the user entered a FQDN, solve the IP address and use that IP address.
$ ping github.com
Haciendo ping a github.com [140.82.113.4] con 32 bytes de datos:
Respuesta desde 140.82.113.4: bytes=32 tiempo=149ms TTL=52
Respuesta desde 140.82.113.4: bytes=32 tiempo=79ms TTL=52
Respuesta desde 140.82.113.4: bytes=32 tiempo=77ms TTL=52
Respuesta desde 140.82.113.4: bytes=32 tiempo=77ms TTL=52
Notice how I was allowed to just type github.com
instead of an IP address.
from cli.
Alright we've finalized on going with the ipinfo $domain
model. I'll implement this soon and include it in #59.
Thanks for all your inputs!
from cli.
Yeah we can implement that, but it would use the user's local DNS setup to resolve the domain, rather than for example make a request to ipinfo.io to do that.
from cli.
I'm not sure there's a compelling use case to build this in - you can just do it with this, which makes it clear where the lookup is happening:
$ dig +short google.com | ipinfo
{
"142.250.217.78": {
"ip": "142.250.217.78",
"hostname": "sea09s29-in-f14.1e100.net",
"city": "Seattle",
"region": "Washington",
"country": "US",
"country_name": "United States",
"loc": "47.6062,-122.3321",
"org": "AS15169 Google LLC",
"postal": "98111",
"timezone": "America/Los_Angeles"
}
}
from cli.
Yeah the part about not knowing for sure, or not being able to control fully, where the IP of the domain is retrieved from kind of reduces the value of this: DNS servers will for example give different IPs via round-robin, geolocation, caching, and possibly more context. If we were to do the DNS lookup on the servers, for example, the results will usually be very different than if done on the client.
from cli.
We can maybe add a simple version of this under a subcommand fqdnip
(FQDN IP, similar to myip
"My IP"), e.g. ipinfo fqdnip google.com
. We would just do the DNS lookup and hand it over to the work that ipinfo <ip>
is doing.
from cli.
I'm not sure there's a compelling use case to build this in - you can just do it with this, which makes it clear where the lookup is happening:
$ dig +short google.com | ipinfo { "142.250.217.78": { "ip": "142.250.217.78", "hostname": "sea09s29-in-f14.1e100.net", "city": "Seattle", "region": "Washington", "country": "US", "country_name": "United States", "loc": "47.6062,-122.3321", "org": "AS15169 Google LLC", "postal": "98111", "timezone": "America/Los_Angeles" } }
The dig command is not part of windows.
from cli.
We can maybe add a simple version of this under a subcommand
fqdnip
(FQDN IP, similar tomyip
"My IP"), e.g.ipinfo fqdnip google.com
. We would just do the DNS lookup and hand it over to the work thatipinfo <ip>
is doing.
I can make a pull req for that. Or maybe insert such behaviour as a special case in the normal ipinfo command
from cli.
The dig command is not part of windows.
You can get dig for windows: https://docs.digitalocean.com/products/networking/dns/resources/use-dig/
I think nslookup comes bundled though
from cli.
I guess if you made a PR I would be open to accepting it, but we should add a disclaimer in the subcommand description (in its -h
message) that the IP looked up may not be the IP others around the world see for the same domain, that it may be cached, etc.
from cli.
@UmanShahzad another important consideration is that dns servers might give different IP addresses depending on the geographic location for distributed applications, like CDNs. Still, the CLI could emulate the behaviour of commands such as ping
or traceroute
, which automatically solve the ip address when using domain names.
from cli.
dns servers might give different IP addresses depending on the geographic location for distributed applications
Yes this is the point I had in mind when mentioning that others around the world may not see the same IP for the same domain, because some globally distributed dns servers will return the IP of the server closest to your location.
from cli.
Some sort of warning could be displayed if neccesary.
from cli.
I agree with such reccomendation.
Would you preffer creating a new sub command, like domain
, or altering the existing default command to deal with FQDN as well as IP addresses?
from cli.
@eacp Definitely a subcommand as fqdnip
, not domain
. But I'll handle this one, no worries.
from cli.
or it can be fqdninfo
from cli.
fqdninfo
or domain
both sound like they're giving domain-specific information, which is something IPinfo provides. But this command isn't doing that so such names aren't the best choice.
from cli.
@eacp that's an interesting idea. I think I actually prefer the idea of supporting ipinfo $domain
and returning the details for the IP that domain resolves to, rather than having a separate ip resolution command, which feels out of scope for the cli.
from cli.
Related Issues (20)
- Country flag emoji oddly displayed HOT 10
- Implement netIP functionalities in CLI HOT 1
- Bug in `ipinfo tool upper` HOT 1
- Windows 11 (Defender): Trojan:Win32/Bearfoos.B!ml Trojan Virus HOT 3
- Piping a list of IP addresses to map and summarize is NOT working HOT 1
- More basic IP tools
- "ipinfo tool aggregate" weirdness HOT 3
- Linux aarch64 not supported HOT 3
- API endpoint for usage HOT 3
- Tool → aggregate function throwing error at file input HOT 1
- Tool → `aggregate` function does not print IPs as is HOT 5
- IPinfo CLI tool command → `aggregate` closer inspection of operation recommended HOT 1
- Even with installation failure the CLI indicates success HOT 1
- Different GLIBC version in 3.3.0? HOT 3
- How it the CLI handles manual input of tokens?
- ipinfo no longer works on Windows 7, Windows Server 2008 HOT 1
- IPinfo CLI Download command: Invalid character 'U' looking for beginning of value
- Windows Defender flagging as Name: Trojan:Win32/Bearfoos.A!ml
- brew install ipinfo-cli
- The aggregate tool does not support IP range aggregation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.