Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a cname record to a dyndns address. This has worked fine in the past, but now if I use the cname error I get a 502 error from IIS 7. The dyndns address works fine and so does the actual ip address. Any ideas on what would cause this?

share|improve this question

Are IIS and your application configured to accept requests on the hostname that you're using to access it? A CNAME record is DNS-specific and won't have anything to do with IIS. The DNS resolver takes whatever you enter into the browser and runs through the DNS resolution process (whether you're using an A record or a CNAME record) until it gets an authoritative IP address back. It then connects to the server at that IP and presents the Host header to the server using the domain name that was entered into the browser. IIS doesn't know or care that the name was a CNAME, only that it's getting a connection on a certain IP and a Host header for some name is being presented.

If your application is bound to a specific IP or IP/hostname combination, then IIS may not know what to do with the request if a different domain name is being presented and you may need to add the new name to your configuration so it knows which web site it belongs to.

Likewise, if your underlying web application is expecting a certain host name it may be generating an internal error when IIS hands it something it's not expecting (through the CGI variables or their equivalent depending on your underlying application framework).

share|improve this answer
It's bound to *:80 and *:443, problem only appears from the cname, but I can use the domain name that the cname is pointing to and it works fine. As does the ip directly. The cname is resolving correctly, but iis is throwing that 502 bad gateway message. – mheckmann May 5 '10 at 19:19

Errors when you are using CNames can be caused by Kerberos. See this hotfix for a fix and a registry key change.

Note that this is required for IE 6, but IE 7 might only require the registry setting...

share|improve this answer
up vote 0 down vote accepted

Found the root cause. I had an old rewrite rule at the server level for that domain name. I had only checked the rewrites at the website level. The domain it was pointing to is now gone, hence the 502 bad gateway message. I disabled the rule and all is fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.