e.g. for mail.google.com would it return google.com or mail.google.com? I can't actually test it myself
Asked
Active
Viewed 7,830 times
21
-
8Why can't you test it for yourself? – Schroedingers Cat Jul 06 '11 at 08:23
-
9Because I'm changing an already live system. I can't deploy this. Running locally gives me localhost for Request.Url.Host – Adam Lynch Jul 06 '11 at 09:52
2 Answers
9
You can save yourself from the headache of waiting for answers by reading documentation on Msdn.
A String that contains the host name. This is usually the DNS host name or IP address of the server.
If the requested DNS record is a subdomain, that's the record it will return. Subdomains are still there own records in a zone file, so its not going to return just the root domain because that's not the same record, nor request.
I was also curious as to why you couldn't test this, but if its because of the lack of an internet connection (maybe you're posting from mobile I don't know) you can add your own records to the Windows HOSTS file and test locally.

David Anderson
- 13,558
- 5
- 50
- 76