问题
Can anyone explain me how the asp.net/iis gets SERVER_NAME variable ?
The problem appears when we change our production domain name. The backend code returns old value by calling the following method Request.ServerVariables["SERVER_NAME"]
.
Could it be related to DNS update ?
回答1:
The backend code returns old value by calling the following method Request.ServerVariables["SERVER_NAME"]
Generally this variable returns
The server's host name, DNS alias, or IP address as it would appear in self-referencing URLs.
Check
- That the DNS changes have propogated to this server. Do a reverse DNS lookup on the server itself. If this is the case, flush the local DNS cache (
ipconfig /flushdns
) - Make sure the DNS PTR record has been correctly updated
- That the host name isn't set to match the old DNS name
来源:https://stackoverflow.com/questions/30125281/asp-net-server-name-returns-wrong-domain-name