1

I know it can take up to a few days for DNS changes to take effect, but this has me baffled, maybe somone can offer a plausible explanation..

$ 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]

Now the above is exactly waht I would expect after a DNS change, so no surprise there, until I tell you that oldserver.html and dns.html have the same output, and newserver.html, differs!

Since HOSTNAME is resolved to NEWIP, how on earth can it have the output of the old server?

Completely baffled.

EDIT: More confusion:

$ 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]

I did this on the NEW server. As you see both requests output 18361 bytes, while the correct output (newserver.html) should output 18112...

OUTPUT 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]

This is clearly the NEW server, old server ran CentOS.

EDIT

Sorry people. It appears the problem is with WordPress.

Exactly to AVOID this type of issues I disabled all forms of caching. Oddly enough when I re-enabled them, I saw the new content. Very, very, very odd.

3
  • 1
    Are both IPs served by the same machine?
    – Skaperen
    Jul 25, 2012 at 14:54
  • Is there a proxy or other cache in the middle somewhere?
    – squillman
    Jul 25, 2012 at 14:57
  • 1: No, different servers. 2: Not that I am aware of. Jul 25, 2012 at 15:23

2 Answers 2

0

I can't comment so I have to answer.

2 things:

  1. If you are using virtualhosts then you need to do your HTTP request on hostname or else you will get the content of the default virtualhost (often the first one defined) and not the virtualhost you're after.

  2. In the output of wget, the connection via hostname shows a real Length (ie the HTTP Content-Length header is returned by the server), whereas the other two responses show "Unspecified".

Oh. and a third thing: can you use wget -S and tell us the server's response?

4
  • 1: there is only one virtualhost. I tried adding ServerName, but it makes no diff. 2: Owkay, not sure what that means though. 3: -S makes no diff. Jul 25, 2012 at 15:22
  • Can you update your original question to reflect the output of wget -S? Jul 25, 2012 at 15:27
  • Is the content of oldserver.html and newserver.html what you expect? Jul 25, 2012 at 15:28
  • It is. It just makes no sense that newserver.html and dns.html are not the same. Jul 25, 2012 at 15:34
0

Sorry people. It appears the problem is with WordPress.

Exactly to AVOID this type of issues I disabled all forms of caching. Oddly enough when I re-enabled them, I saw the new content. Very, very, very odd.

1
  • No, just very very new to WordPress. Jul 26, 2012 at 12:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .