Get domain name from URL
How to Get host domain from URL?

A URI (uniform resource identifier ) is a representation of a resource available to your application on the network. You can retrieve host of a url by using Request object or Uri.
Get domain name of a url
Using Request.Url
VB.Net
C#
Using Uri
C#
VB.Net
Or u can parse the url using regex

How to parse a domain from URL?
C#
How to get domain part from URL
VB.Net
Extract domain name from URL
A better way you could go without the need for regular expression or parsing is to use the below code.