Forum Moderators: phranque

Message Too Old, No Replies

PHP Web Form resolves to old (wrong) DNS MX Record

I updated to new MX records, but PHP script still sends to old email servic

         

jghomestead

10:24 pm on Feb 18, 2011 (gmt 0)

10+ Year Member



I have a mysterious problem with my PHP contact form not resolving to the correct email account.

I recently changed hosting service and obviously this required me to migrate my whole website to a new server.

My old hosting company, I'll call them "Badhost," also provided me with free email accounts for my domain.

My domain has always been registered with Network Solutions.

About 8 months ago, I switched my hosting services from Badhost to Network Solutions, and I switched my email services to Rackspace.

My new hosting package with NS uses the Unix OS and Apache server.

I still use the same PHP script in my contact form that I used when it was hosted with Badhost, but I've just made a few changes in the string-objects that get sent in my call to the PHP
mail()
function.

I updated the MX records in my NS account with the proper Rackspace records. (This was months ago and the MX records still correctly point to Rackspace.)

Most contact form requests submitted through my PHP script resolve correctly to my Rackspace email inbox.

However, once every month or so, I'll get a submission that resolves to my old Badhost email account as if I still used the Badhost MX records (I have NOT YET closed the Badhost account). On top of that, the submitted contact information is in the old format (by that I mean the email message does not reflect how I changed the string-objects in my PHP
mail()
call).

I am not sure what to do. The annual billing cycle for Badhost is approaching and I obviously do not want to renew with them. But what will happen to those emails that resolve to the Badhost account if I close the account?

I don't understand why, with new MX records, would my PHP script send an email to the old email account? And I really don't understand why it seems like the PHP script itself is my old, out-of-date script using my old formatting.

Should I close my Badhost account and just hope that once it's disabled all my PHP form submissions will resolve correctly to Rackspace?

jdMorgan

12:17 am on Feb 19, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds to me like users (or their ISPs) who've got a cached copy of the form generated by your script, plus really old DNS lookup values (still pointing to the badhost IP address).

Do these 'obsolete-format' e-mails have anything in common as far as what ISP (or few ISPs) they are sent from/through?

If your site (with the mail script) and your e-mail address are all based on your domain name, and you've updated your DNS pointers, then that's my only guess... Some ISP(s) who've got long-lived caches and stale DNS.

If you want to reassure yourself that it's OK to let the badhost account expire, then go update the script on badhost to have it send you something you can identify. If nothing changes in the old-bad-format emails you receive subsequently, that would indicate that the cause is as I describe above.

Also, check the cache-control headers on your pages, and especially on your mail form and related pages. Make sure that you are positively declaring reasonable expiry times on your pages (a few days max) and on all included objects (30 days max) on tose pages. The Live HTTP Headers add-on for Firefox/Mozilla is quite useful for this kind of checking. (There are others as well, I've just used LHTTPH for years. It's part of the basic Webmaster kit.)

I dunno, I can't give you any definitive answers, just some trails to check...

Jim

jghomestead

7:06 pm on Feb 21, 2011 (gmt 0)

10+ Year Member



Thanks for the suggestions Jim.

Yes, both my site and email address in the mail script are based on my domain name.

I'll check these things out to see if they leave me any clues.

jghomestead

1:09 pm on Mar 16, 2011 (gmt 0)

10+ Year Member



I finally had some time to look into this problem and I think I figured out how people were still accessing the old website hosted on the old Badhost server.

It was pretty simple... I simply overlooked one of our many domain names that was still pointing to the Badhost server!

I discovered this by going to [squish.net...] and just typing in our domain name plus all other domain name aliases that were supposed to point to the same website.

Upon doing this is when I found that one domain name was still resolving to the old DNS record to Badhost.

It was easily fixed obviously by getting into my domain account and changing the nameserver records for that stray domain.

This is the only way I see it could have been possible for people to still be accessing the old website with the old contact form on the old server. I think this should have definitely fixed my problem.