Failed to register Windows Phone device with developer account

I got the following message when trying to register my HTC Trophy Windows Phone 7 device (with mango installed) with my developer account on AppHub, by using the Windows Phone Developer Registration application, Failed to Register Device to Developer Account (Error Code 0x64).

This is the detailed error message, Error communicating with the developer portal. Please set the correct date and time on the phone, check the Internet connection and try again later.

I looked at various things, including the hosts file, typically located in the C:\Windows\System32\drivers\etc folder. It contained an entry for the address. I deleted the entry, saved the hosts file, and then did a ipconfig /flushdns from a Command Prompt, closed the Command Prompt, waited a minute or two and retried the registration; SUCCESS. 🙂