Giter Club home page Giter Club logo

Comments (19)

UmanShahzad avatar UmanShahzad commented on July 22, 2024 1

Some sort of warning could be displayed if neccesary.

I recommended:

we should add a disclaimer in the subcommand description

from cli.

eacp avatar eacp commented on July 22, 2024 1

@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.

UmanShahzad avatar UmanShahzad commented on July 22, 2024 1

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.

UmanShahzad avatar UmanShahzad commented on July 22, 2024

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.

coderholic avatar coderholic commented on July 22, 2024

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.

UmanShahzad avatar UmanShahzad commented on July 22, 2024

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.

UmanShahzad avatar UmanShahzad commented on July 22, 2024

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.

eacp avatar eacp commented on July 22, 2024

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.

eacp avatar eacp commented on July 22, 2024

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.

I can make a pull req for that. Or maybe insert such behaviour as a special case in the normal ipinfo command

from cli.

coderholic avatar coderholic commented on July 22, 2024

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.

UmanShahzad avatar UmanShahzad commented on July 22, 2024

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.

eacp avatar eacp commented on July 22, 2024

@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.

UmanShahzad avatar UmanShahzad commented on July 22, 2024

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.

eacp avatar eacp commented on July 22, 2024

Some sort of warning could be displayed if neccesary.

from cli.

eacp avatar eacp commented on July 22, 2024

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.

UmanShahzad avatar UmanShahzad commented on July 22, 2024

@eacp Definitely a subcommand as fqdnip, not domain. But I'll handle this one, no worries.

from cli.

kamilmirza avatar kamilmirza commented on July 22, 2024

or it can be fqdninfo

from cli.

UmanShahzad avatar UmanShahzad commented on July 22, 2024

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.

coderholic avatar coderholic commented on July 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.