Dns.gethostentry Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business dns.gethostentry no such host is known Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Dns.gethostentry Fails On Ip Address
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like dns c# you, helping each other. Join them; it only takes a minute: Sign up Dns.GetHostEntry error conditions and resolution methods up vote 7 down vote favorite 1 I have a very specific problem concerning Dns.GetHostEntry: A service uses system.net.sockets.socketexception no such host is known c# Dns.GetHostEntry to retrieve all IP Adresses of a host, using the name of of the host. This has always worked fine. At a specific customer, Dns.GetHostEntry throws the "no such host is known" error when querying specific hosts. The problem only occurs when trying to resolve hosts that are on a different domain than the machine the service is installed on. The service has worked for quite some time, but recently is stopped working, throwing the
Iphostentry
"no such host is known" error (sadly, no stack trace is available). Nslookup works though, no problems there. The service in question is written in VB.NET, targetting the .NET Framwork 2.0. The comments in the MSDN entry for .NET 3.0 (http://msdn.microsoft.com/en-us/library/ms143998(v=VS.85).aspx indictate that there may be a problem with the reverse DNS entries for the hosts, but I was not able to reproduce the problem on a test network, even with all reverse lookup zones deleted (there are more comments for other .NET Versions, all having similiar problems). [EDIT:] Even deliberatly addind a wrong PTR record does not make the problem occur on my test machine. [EDIT2:] The only thing that made the error come up was disconnecting the network adapter, and thereby making the DNS Server unavailable, even though the forward resolving still worked due to caching. So, my questions are: Under which conditions does GetHostEntry throw this specific error? Which resolution methods does it use? If I'm not mistaken it uses the unmanaged WinSock function getnameinfo (http://msdn.microsoft.com/en-us/library/ms738532(v=vs.85).aspx),: "Name resolution can be by the Domain Name System (DNS), a local hosts file, or by other naming mechanisms". Any ideas why this suddenly fails for machines on the other domain (but not for machines on the same domain)? Thanks and best regards, cun83 .net vb.net active-directory dns resolve share|improve this question edited Feb 7
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/General ASP.NET/Getting Started/How to resolve "No such host is known" How to resolve "No such host is known" [Answered]RSS 5 replies c# get ip from hostname Last post Nov 01, 2012 04:09 AM by RameshRajendran ‹ Previous Thread|Next dns.gethostaddresses no such host is known Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Reply
Vb.net No Such Host Is Known
chiall2004 Member 21 Points 91 Posts How to resolve "No such host is known" Nov 01, 2012 12:10 AM|chiall2004|LINK Hi, I need to get the computer's namewhile the page load. But http://stackoverflow.com/questions/4896180/dns-gethostentry-error-conditions-and-resolution-methods sometimes I getting the error msg as"No such host is known". But sometimes it works fine without error. For Info, we are using dynamic IP for some of the PC. Anybody know how to resolve my problem System.Net.IPHostEntry host = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]); string ComputerName = host.HostName.ToString().ToUpper().Replace(".CDC.INTRANET", ""); LEENO Reply oned_gk All-Star 49198 Points 14282 Posts Re: How to resolve "No such host is http://forums.asp.net/t/1855430.aspx?How+to+resolve+No+such+host+is+known+ known" Nov 01, 2012 12:17 AM|oned_gk|LINK Are the clients in same vlan?I think can not get Computer Name from deferent vlan. Programming to simplify, don't look for hardway ... Suwandi - Non Graduate Programmer Reply chiall2004 Member 21 Points 91 Posts Re: How to resolve "No such host is known" Nov 01, 2012 12:32 AM|chiall2004|LINK Is within same vlan. Sometimes it works fine, but sometimes system will thrown error msg "No such host is known" LEENO Reply oned_gk All-Star 49198 Points 14282 Posts Re: How to resolve "No such host is known" Nov 01, 2012 02:45 AM|oned_gk|LINK try System.Net.IPHostEntry host = System.Net.Dns.GetHostEntry(Request.UserHostAddress); Programming to simplify, don't look for hardway ... Suwandi - Non Graduate Programmer Reply Veera Pallat... Member 458 Points 199 Posts Re: How to resolve "No such host is known" Nov 01, 2012 04:00 AM|Veera Pallati|LINK Hi, Use the following code snippet <%= System.Net.Dns.GetHostName() %> or <%= System.Environment.MachineName %> Thanks & regards Veera Pallati Reply RameshRajend... Contributor 4554 Points 1770 Posts Re: How to resolve "No such host is known" Nov 01, 2012 04:09 AM|RameshRajendran|LINK Ref this http://support.microsoft.com/kb/2643086 and check this http://forums.asp.net/t/1333633.aspx http://sitecorebasics.wordpress.
Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your http://www.codeproject.com/Questions/394325/DNS-not-working-on-online-server Blog quick answersQ&A Ask a Question View Unanswered Questions View All Questions... C# questions Linux questions ASP.NET questions SQL questions VB.NET questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / no such STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase no such host Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ DNS not working on online server Rate this: Please Sign up or sign in to vote. See more: ASP.NET Hi, I want client machine name where the ASP.Net web application is running. I am using below code: var hostEntry = Dns.GetHostEntry(Request.UserHostAddress); Response.Write("machinename=" + hostEntry.HostName); Its working Offline but not working on online server. It shows this error: Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: