<p>I wanted to show the users Name Address (see <a href="http://www.ipchicken.com" rel="nofollow noreferrer">www.ipchicken.com</a>), but the only thing I can find is the IP Address. I tried a reverse lookup, but didn't work either:</p>

<pre><code>IPAddress ip = IPAddress.Parse(this.lblIp.Text);
string hostName = Dns.GetHostByAddress(ip).HostName;
this.lblHost.Text = hostName;
</code></pre>

<p>But HostName is the same as the IP address.</p>

<p>Who know's what I need to do?</p>

<p>Thanks.
Gab.</p>

[{'answer_id': 17797, 'author': 'saniul', 'author_id': 52, 'author_profile': 'https://Stackoverflow.com/users/52', 'pm_score': 0, 'selected': False, 'text': "<p>Not all IP addresses need to have hostnames. I think that's what is happening in your case. Try it ouy with more well-known IP/hostname pairs eg:</p>\n\n<blockquote>\n  <p>Name: google.com Address: 72.14.207.99</p>\n  \n  <p>Name: google.com Address:\n  64.233.187.99</p>\n  \n  <p>Name: google.com Address:\n  64.233.167.99</p>\n</blockquote>\n\n<p>...I might just be wrong</p>\n"}, {'answer_id': 17799, 'author': 'Vaibhav', 'author_id': 380, 'author_profile': 'https://Stackoverflow.com/users/380', 'pm_score': 0, 'selected': False, 'text': "<p>A lot of users have the same shared IP address, so you will not be able to find their hostnames. And a lot of users won't necessarily have DNS records in public DNS for the IPs they are coming from as well.</p>\n"}, {'answer_id': 17801, 'author': 'seanyboy', 'author_id': 1726, 'author_profile': 'https://Stackoverflow.com/users/1726', 'pm_score': 3, 'selected': True, 'text': '<p>Edit of my previous answer. \nTry (in vb.net): </p>\n\n<pre><code>    Dim sTmp As String\n    Dim ip As IPHostEntry\n\n    sTmp = MaskedTextBox1.Text\n    Dim ipAddr As IPAddress = IPAddress.Parse(sTmp)\n    ip = Dns.GetHostEntry(ipAddr)\n    MaskedTextBox2.Text = ip.HostName\n</code></pre>\n\n<p>Dns.resolve appears to be obsolete in later versions of .Net. As stated here before I believe the issue is caused by your IP address not having a fixed name or by it having multiple names. The example above works with Google addresses, but not with an address we use that has a couple of names associated with it. </p>\n'}, {'answer_id': 17802, 'author': 'Adam Haile', 'author_id': 194, 'author_profile': 'https://Stackoverflow.com/users/194', 'pm_score': 2, 'selected': False, 'text': '<p>You need the Dns.Resolve() method from System.Net</p>\n\n<p>See this <a href="http://www.c-sharpcorner.com/UploadFile/DougBell/NSLookUpDB00112052005013753AM/NSLookUpDB001.aspx" rel="nofollow noreferrer">article</a></p>\n'}, {'answer_id': 17810, 'author': 'Michał Piaskowski', 'author_id': 1534, 'author_profile': 'https://Stackoverflow.com/users/1534', 'pm_score': 1, 'selected': False, 'text': "<p>Also remember that reverse lookup won't allways give the same address as the one used in forward DNS lookup.<br />\n<br />\nFor example for google.com I get ip 64.233.167.99<br />\nbut reverse dns lookup for that IP returns py-in-f99.google.com </p>\n"}, {'answer_id': 17839, 'author': 'Gabriël', 'author_id': 2104, 'author_profile': 'https://Stackoverflow.com/users/2104', 'pm_score': 2, 'selected': False, 'text': '<p>Stupid me... The code is posted was 100% valid and working... But 10 lines lower I replaced the this.lblHost.Text with another value, which happened to be the ip address.</p>\n\n<p>Sorry.</p>\n'}]
['https://Stackoverflow.com/questions/17795', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2104/']