简体   繁体   中英

global.asax code working fine in local but not after deploying on IIS

I have below code in global.asax. I am getting remote_addr details in my local but not after deployment.

log4net.GlobalContext.Properties["username"] = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.ToString();

To get the Host Name, you need to turn the reverse dns lookup on. It is a behavioral change in IIS. system.webServer/security/ipSecurity@doReverseDns and get the REMOTE_HOST server variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM