Adam Lynch
Adam Lynch

Reputation: 3369

Does Request.Url.Host include the subdomain?

e.g. for mail.google.com would it return google.com or mail.google.com? I can't actually test it myself

Upvotes: 23

Views: 8470

Answers (2)

David Anderson
David Anderson

Reputation: 13680

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 their 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.

You can also add your own records to the Windows HOSTS file and test locally or in /etc/hosts on linux/unix including OSX.

Upvotes: 9

Marek Musielak
Marek Musielak

Reputation: 27142

It does include subdomain (e.g. mail.google.com)

Upvotes: 29

Related Questions