如何找到网站的ip地址?

不管你是为了好玩,还是真的想知道答案,你是如何找到一个网站的IP地址的?今天的超级用户问答帖子将讨论答案,以及如何知道是否有多个网站绑定到同一IP地址。...

如何找到网站的ip地址?

不管你是为了好玩,还是真的想知道答案,你是如何找到一个网站的IP地址的?今天的超级用户问答帖子将讨论答案,以及如何知道是否有多个网站绑定到同一IP地址。

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的问答网站分组。

问题

超级用户读者JqueryLearner想知道如何找出网站的IP地址:

If I want to know the IP address of a website, then one way is to ping the website. For example, if I want to know the IP address of google.com, then I can ping it via the command prompt.

007Ys3FFgy1gpfnh5fw1jj30fm044aad

So 74.125.236.195 is the IP address for Google. But suppose I want to know the IP address of superuser.com, and if I use the same method, then I get 198.252.206.16 as the IP address. If I put this IP address in the browser as an URL, then my browser does not take me to superuser.com.

Can anyone tell me how to get the correct IP address?

那么JqueryLearner需要做什么才能找到网站的正确IP地址呢?

答案

超级用户贡献者Paul和lesca为我们提供了答案。首先,保罗:

Your starting assumption is that all websites can be accessed via their IP address directly. This is not the case.

In many cases (I’d venture most cases), the website that is presented at an IP address is dependent on the website name you are requesting. For example, if you request superuser.com, you will first resolve this to an IP address, then make a request to the IP address for a specific webpage. It looks like this:

007Ys3FFgy1gpfnh64c7rj30fm01nq2s

The first part says “get the first page of the site”, and the second says “for the website superuser.com”.

This is why a single web server can host multiple websites using a single IP address. In the case of the Stack Exchange sites, any or all of them can be on each of their servers, and you’ll get the one you ask for. If you just put in an IP address, you won’t get any of them, because you are not telling the web server which of the many websites you are after. In these cases, it may have a “default” website defined, or just return an error.

If you are trying to work around an issue with your DNS provider, then one option you have is to modify your hosts file so that you are resolving addresses yourself, rather than have an external party do it for you.

So for example, if you edit:

007Ys3FFgy1gpfnh6rqbhj30fm01nt8m

You can enter:

007Ys3FFgy1gpfnh7yid4j30fm010q2r

This way, if you type superuser.com into your browser, it will look in the hosts file, and resolve the IP address, but then still pass through the name of the website to the server it connects to.

接着是莱斯卡的回答:

To get the IP address of a website, the best way is to use the nslookup command. For example:

007Ys3FFgy1gpfnh8mcjrj30fm04qt8s

If you wonder why you cannot visit SuperUser directly using the IP address (198.252.206.16), it is because of the settings for the web server. The SuperUser site disallows user visits via IP address. Probably it is because the IP address is binding to other web sites (say stackoverflow.com). If you use “IP reverse lookup” tool, you can find its binding sites.

One more lookup proves I am right:

007Ys3FFgy1gpfnh985u3j30fm04qaa5


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-04-11 11:36
  • 阅读 ( 288 )
  • 分类:互联网

你可能感兴趣的文章

什么是ip地址?它能显示你住在哪里吗?

...P地址的全名是“Internet协议地址”。它的全名说明了它是如何工作的;它是计算机发送和接收数据的地址。 ...

  • 发布于 2021-03-21 11:51
  • 阅读 ( 334 )

如何将imessage与airmessage和mac一起在android上使用

... 以下是你需要知道的以及如何使用它。 ...

  • 发布于 2021-03-21 16:37
  • 阅读 ( 265 )

什么是dns缓存中毒?dns欺骗如何劫持你

... 让我们看看DNS缓存中毒是如何工作的,以及如何避免它。 ...

  • 发布于 2021-03-21 18:02
  • 阅读 ( 203 )

如何找到android或iphone的ip地址

需要找到你的移动IP地址吗?你可能知道如何在你的Mac或Windows电脑上找到你的IP地址,但在你的**上呢? ...

  • 发布于 2021-03-22 11:33
  • 阅读 ( 286 )

什么是vpn泄漏?如何检测和预防

... 如何测试vpn ip地址泄漏 ...

  • 发布于 2021-03-25 00:48
  • 阅读 ( 300 )

如何使用ipstack api进行ip地理位置查找

...请继续阅读以了解有关此IP地理定位工具的更多信息以及如何使用它。 ...

  • 发布于 2021-03-25 03:02
  • 阅读 ( 264 )

如何加入minecraft服务器

...生成的积木世界吗?别再看了,这里有你需要知道的关于如何加入Minecraft服务器的所有信息。 ...

  • 发布于 2021-03-26 19:34
  • 阅读 ( 342 )

如何在mac上查找和更改ip地址

... 下面介绍如何在需要时查看和更改Mac上的IP地址。 ...

  • 发布于 2021-03-30 19:17
  • 阅读 ( 347 )

执法部门真的能追踪到有ip地址的人吗?

...它们允许ISP更容易地进行维护和资源调配。 相关:IP地址如何工作? 网站保留日志 大多数网站都会保留关于访问者的详细日志,这是有充分理由的。如果你知道如何阅读这些,你可以了解你的网站是如何被外部第三方使用。 现...

  • 发布于 2021-04-02 00:15
  • 阅读 ( 191 )

如何隐藏您的ip地址(以及您可能希望隐藏的原因)

...许多人来说,要么被监视,要么没有互联网。 那么我该如何隐藏我的ip地址呢? 隐藏IP地址的两种主要方法是使用代理服务器或虚拟专用网(VPN)。(还有Tor,它非常适合于极端匿名化,但是它非常慢,对于大多数人来说是不必...

  • 发布于 2021-04-04 09:59
  • 阅读 ( 302 )
小贝的新发型
小贝的新发型

0 篇文章

相关推荐