Restricting access to a website by IP address range / domain

懵懂的女人 提交于 2020-01-06 07:20:31

问题


I would like advice on the best way to restrict access to a weba pplication (using .net 2.0 and II6) based on the clients IP address. The two ways I am considering:

1) Through the server side code - check the client I.P against a list of IP addresses within the web.config.

2) Through IIS by creating a virtual directory and restricting the I.P addresses on this virtual directory.

My question is if I go the virtual directory route there are a lot of users that access this website and I have read reverse domain lookups made during each client request can be very expensive on server resources. How much of a risj is this?

Any other suggestions /ideas to doing this would be much appreciated

Thanks advance,


回答1:


If you go the second route (virtual directory), there will not be any reverse lookups done unless you filter on domain names. If you are restricting by IP addresses (or ranges of addresses), this never comes into play.

See the bit at the bottom of this MS bulletin:

If you use domain name restrictions, the server has to perform a reverse DNS lookup for each request to check the host's registered domain name. Microsoft recommends that you use an IP address or network range whenever you can.



来源:https://stackoverflow.com/questions/1544898/restricting-access-to-a-website-by-ip-address-range-domain

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