This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
DNS.GetHostName (or similar) returns the incorrect DNS name of the localcomputer - if the hostname is different from the DNS name.
For example:
Current computername in Widows - WIN-12345
Updated computername in DNS - ABC-XYZ.mydomain.com
This is the only DNS entry for the device.
I want to query DNS to return the latter of the two above, running ON the device in question (192.168.1.1):
Console.Writeline(DNS.GetHostName(IPAddress.Parse("192.168.1.1")));
WIN-12345
If I query that same computer from a remote device with the code, I am returned the correct DNS name:
ABC-XYZ.mydomain.com
So, when run locally, not only does it not return the FQDN, but it also returns the incorrect name that DNS holds.
I have had to revert a process running NSLOOKUP to return the correct information.
Any ideas how to query DNS correctly in this situation using native code?
Subreddit
Post Details
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/csharp/comm...