开发者

Resolving DNS in ASP.NET (MVC) to Host Name/Proxy

Alright, this question sounds a bit stupid, I know. I've looked at some of the other questions about it and I'm getting inconsistent results, even though I am finding the right answers. I'll try to lay it out as plainly as I can.

I have a problem where a large number of visitors to my site are using a ...I use the term popular very loosely, internet service (AOL) to access it. This is beyond开发者_StackOverflow中文版 my control. It is a large part of the userbase and I cannot stop them from using its built in browser (which derives from IE).

Now, this isn't the inherit problem. The problem is that any sites accessed through the browser go through one of their proxies. This does not cause any conflicts, but we need to know who is unique and who isn't for some specific reasons.

I have an installation of a popular message board system called "Invision Power Board". It tracks people's IP Address's and it has a feature to resolve an IP. So, I can click on an IP, and it will 'resolve' to a host like ..

IP XX.XXX.XX.XXX resolves to cache-dtc-ae16.proxy.aol.com.

Now I understand kind of what is going on here. cache-dtc-ae16.proxy.aol.com is a proxy, so I can't do much about that. I've come to terms with that. The code that does this is in IPB, and I don't speak PHP, so I'm SOL in that department.

I know how to get a User's IP Address.

HttpContext.Request.UserHostAddress

What I want to know is this ... from an IP, how can I 'resolve' to that proxy, in C#? I basically want to setup a specific part of code that denies anything from a proxy that has .aol. in it.

Does what I am trying to make any sense, is it even feasible or possible? I may be completely missing the terminology. I believe I understand this much.

UserHostAddress is the **client's** IP Address

Here is what I have tried, basically.

System.Net.Dns.GetHostEntry(System.Net.IPAddress.Parse(HttpContext.Request.UserHostAddress)).Aliases


are you trying to get the domain name from the ip? it looks like your answer is in this question here

IPHostEntry IpToDomainName = Dns.GetHostEntry("209.85.129.103");
string HostName = IpToDomainName.HostName; //it returns "fk-in-f103.1e100.net"


This is a limitation of TCP protocol. The address is part of the TCP packet and as far as I know, routers and switches and NATs and proxies change the address and put their own.

As far as I know, there is no way around it. Proxy's address is as good as you gonna get.

I believe even TCP packet's MAC (physical) address is going to be proxy's but that is something to look at although not sure if you can get that in ASP.NET runtime since a request can come in multiple TCP packets.


try this

NullifyNetwork - A comprehensive Microsoft DNS Server management implementation in C#

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜