Skip to content

Dns.GetHostEntryAsync may produce an error such as "(0x00002AF9): No such host known" #186

@xuzimianxzm

Description

@xuzimianxzm

🐛 Bug Report

🔬 How To Reproduce

Steps to reproduce the behavior:

This problem may not be easy to reproduce. It is related to the underlying system. I use a custom compiled Linux system. It may be because it does not have a DNS service. Although I set the MQTT server connection address to an IPv4 IP address, it still throws an exception in this line of code in the HiveMQClientSocket.cs file:
IPHostEntry ipHostEntry = await Dns.GetHostEntryAsync(this.Options.Host).ConfigureAwait(false);

image

Code sample

System.Net.Sockets.SocketException (0x00002AF9): No such host known。
at System.Net.Dns.GetHostEntryOrAddressesCore(IPAddress address, Boolean justAddresses, AddressFamily addressFamily, Nullable1 startingTimestamp) at System.Net.Dns.GetHostEntryCore(IPAddress address, AddressFamily addressFamily, Nullable1 startingTimestamp)
at System.Net.Dns.<>c.b__33_1(Object s, Int64 startingTimestamp)
at System.Net.Dns.<>c__DisplayClass39_01.<RunAsync>b__0(Task <p0>, Object <p1>) at System.Threading.Tasks.ContinuationResultTaskFromTask1.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---

Environment

Customer Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions