asp.net SERVER_NAME returns wrong domain name

蹲街弑〆低调 提交于 2020-05-15 06:44:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!