改变了DNS,本地没有效果

我知道DNS更改可能需要几天的时间才能生效,但这让我感到莫名其妙,也许somone可以提供一个合理的解释。

$ wget http://***OLDIP***/ -O oldserver.html --2012-07-25 16:31:19-- http://***OLDIP***/ Connecting to ***OLDIP***:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: `oldserver.html' [ <=> ] 18,359 --.-K/s in 0.01s 2012-07-25 16:31:20 (1.61 MB/s) - `oldserver.html' saved [18359] $ wget http://***NEWIP***/ -O newserver.html --2012-07-25 16:31:35-- http://***NEWIP***/ Connecting to ***NEWIP***:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: `newserver.html' [ <=> ] 18,112 --.-K/s in 0.01s 2012-07-25 16:31:35 (1.27 MB/s) - `newserver.html' saved [18112] $ wget http://***HOSTNAME***/ -O dns.html --2012-07-25 16:31:49-- http://***HOSTNAME***/ Resolving ***HOSTNAME***... ***NEWIP*** Connecting to ***HOSTNAME***|***NEWIP***|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 18361 (18K) [text/html] Saving to: `dns.html' 100%[===================================================================================================================================================================================================>] 18,361 --.-K/s in 0.01s 2012-07-25 16:31:49 (1.26 MB/s) - `dns.html' saved [18361/18361] 

现在,上面的内容正是我在DNS更改之后所期待的,所以在这里没有意外,直到我告诉你,oldserver.html和dns.html具有相同的输出,而newserver.html不同!

由于HOSTNAME被parsing为NEWIP ,所以它怎么能有旧服务器的输出呢?

完全困惑。

编辑:更混乱:

 $ wget http://***HOSTNAME***/ -O dns.html --2012-07-25 17:23:45-- http://***HOSTNAME***/ Resolving ***HOSTNAME*** (***HOSTNAME***)... ***NEWIP*** Connecting to ***HOSTNAME*** (***HOSTNAME***)|***NEWIP***|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 18361 (18K) [text/html] Saving to: `dns.html' 100%[===================================================================================================================================================================================================>] 18,361 --.-K/s in 0s 2012-07-25 17:23:45 (142 MB/s) - `dns.html' saved [18361/18361] $ sudo vim /etc/hosts $ wget http://***HOSTNAME***/ -O dns.html --2012-07-25 17:24:53-- http://***HOSTNAME***/ Resolving ***HOSTNAME*** (***HOSTNAME***)... 127.0.0.1 Connecting to ***HOSTNAME*** (***HOSTNAME***)|127.0.0.1|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 18361 (18K) [text/html] Saving to: `dns.html' 100%[===================================================================================================================================================================================================>] 18,361 --.-K/s in 0s 2012-07-25 17:24:53 (144 MB/s) - `dns.html' saved [18361/18361] 

我在NEW服务器上做了这个。 正如你所看到的两个请求输出18361字节,而正确的输出(newserver.html)应输出18112 …

输出wget -S

 $ wget -S http://***HOSTNAME***/ --2012-07-25 17:19:51-- http://***HOSTNAME***/ Resolving ***HOSTNAME***... ***NEWIP*** Connecting to ***HOSTNAME***|***NEWIP***|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Date: Wed, 25 Jul 2012 15:19:45 GMT Server: Apache/2.2.22 (Ubuntu) Last-Modified: Tue, 24 Jul 2012 08:13:21 GMT Accept-Ranges: bytes Content-Length: 18361 Vary: Accept-Encoding Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8 Length: 18361 (18K) [text/html] Saving to: `index.html.1' 100%[===================================================================================================================================================================================================>] 18,361 --.-K/s in 0.01s 2012-07-25 17:19:51 (1.47 MB/s) - `index.html.1' saved [18361/18361] 

这显然是新的服务器,旧的服务器运行CentOS。

编辑

对不起人。 看来问题出在WordPress上。

正是为了避免这种types的问题,我禁用了所有forms的caching。 奇怪的是,当我重新启用它们,我看到了新的内容。 非常非常奇怪

我不能评论,所以我不得不回答。

2件事情:

  1. 如果您使用的是虚拟主机,那么您需要在主机名上进行HTTP请求,否则您将获得默认虚拟主机(通常是第一个定义的虚拟主机)的内容,而不是您之后的虚拟主机。

  2. 在wget的输出中,通过主机名的连接显示一个实际的长度(即HTTP服务器返回的HTTP Content-Length头),而另外两个响应显示“Unspecified”。

哦。 第三件事:你可以使用wget -S并告诉我们服务器的响应吗?

对不起人。 看来问题出在WordPress上。

正是为了避免这种types的问题,我禁用了所有forms的caching。 奇怪的是,当我重新启用它们,我看到了新的内容。 非常非常奇怪