none
"No such host is known" error came when execute the Method [System.Net.Dns]::GetHostEntry("10.0.0.1") through Powershell script RRS feed

  • Question

  • we have 5+ Dns server in our Network and i have added all Dns server in Client Machine NIC card(Go To Advanced TCP/IP Settings - The Second Tab(DNS) - Append The DNS Suffix in Order).
    when i tried in client machine to get the Hostname for an Ip using the method [System.Net.Dns]::GetHostEntry("10.111.16.48") in Powershell.It throws an error like "No such host is known". (The IP "10.111.16.48" has both A and PTR Records in one server (Server4.net)).
    Then I moved the Dns server(server.net) to top in NIC(Go To Advanced TCP/IP Settings - The Second Tab(DNS) - Append The DNS Suffix in Order) and flush the dns(ipconfig/flushdns) and tried the GetHostEntry Method through Powershell. It resolves the hostname perfectly.But Now the Ip which is moved to second DNS Server(tul.server1.com) in the NIC(DNS / DNS Suffixes) list is not resolving.That is only the ip at first in NIC card is getting resolved and others are not.  Do you have any idea? Please suggest.

    Thursday, February 19, 2015 1:11 PM

Answers

  • Hello David,

    From your description, since you are using the powershell script to run this method, I am not sure if this is the caused reason, I suggest that you could create a C# console application which could help narrow this issue, if it works with c# console application, you could ask this issue to the powershell script related forum.

    If it still not work, you could check this link, using the Dns.GetHostAddresses instead to see if it works.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 20, 2015 9:06 AM
    Moderator