Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell if a URL is an intranet url?

Tags:

c#

.net

Using C# how would one determine if a URL is an intranet URL? I would like some code to do something if a URL is an intranet one vs public.

like image 209
Omar Shahine Avatar asked Sep 11 '09 18:09

Omar Shahine


People also ask

How do you know if a website is intranet or Internet?

You can look in File -> Properties. Press Alt to display the menu bar if it's not there. There you can see "Local intranet" or "Internet".

Does an intranet use domain?

Intranet Domain means a domain name, host name or IP address assigned to a Device, not accessible from the Internet (not publicly facing), and owned by the Subscriber used in a Symantec Trust Network Class 3 organizational SSL Certificate.

How do I access intranet?

For an employee to have access to the Intranet, they must have a special network password and be connected to the LAN. If you have remote employees, they can connect remotely to the Intranet via a virtual private network (VPN).


2 Answers

you cannot implicitely know. if your intranet urls look like fully qualified domain names then it's difficult to tell. the only way to tell is to query two different DNS-servers (your own and a public one). If both return the same result, then it's an internet domain. if the public DNS-server isn't able to resolve the address, then it's most likely an intranet domain.

like image 88
Atmocreations Avatar answered Sep 18 '22 12:09

Atmocreations


Do you know the internal subnets (in terms of IP addresses)? If so, I'd just resolve the host name and see if it's internal that way.

like image 45
Jon Skeet Avatar answered Sep 20 '22 12:09

Jon Skeet