0

how get all the subdomains from a url

for example I have this url: www.fk8.ir

and this url have 4 subdomains for example:

  1. test1.www.fk8.ir
  2. mytest.www.fk8.ir
  3. sample.www.fk8.ir
  4. stack.www.fk8.ir

input is: www.fk8.ir

output:

test1.www.fk8.ir

mytest.www.fk8.ir

sample.www.fk8.ir

stack.www.fk8.ir

Farid Karami
  • 219
  • 2
  • 7
  • I am curious how does one determine sub domains from a url in general ? – Veverke Jun 29 '16 at 12:50
  • 3
    http://stackoverflow.com/questions/131989/how-do-i-get-a-list-of-all-subdomains-of-a-domain –  Jun 29 '16 at 12:51
  • Request.Url.Host [SO question](http://stackoverflow.com/questions/6593456/does-request-url-host-include-the-subdomain) for more info – isxaker Jun 29 '16 at 12:55
  • @isxaker: in the case of the question's scenario, will `Request.Url.Host` hold multiple subdomain values ? I tried running a sample on his url but I am having timeout problems for some reason (likely firewall here) – Veverke Jun 29 '16 at 13:25
  • https://msdn.microsoft.com/en-us/library/system.uri.host.aspx – isxaker Jun 29 '16 at 13:39

0 Answers0