How to get domain name from IP address

2k Views Asked by At

I have a website hosted on a shared server. When I use DNS.GetHostEntry(IPAddress) function what I am getting is a domain name for shared server (Name server). I want to fetch the actual domain name.

Does anyone have idea about this?

2

There are 2 best solutions below

0
On

If you are on a shared server, then the IP maps to multiple domain names. There is no "actual" domain name.

0
On

It's (theoretically) possible, but unlikely for you to work.

What you are looking for is a reverse DNS lookup with multiple PTR records. However, given that you're on a shared server, there are likely more than just your domain, and even if the procedure were working, you'd get a list of many domains, among which you'd have to look for the one you were actually interested in... rendering the whole action pointless.