Relative Content

Tag Archive for cnetworking

Why can I ping a unit, but when I attempt DNS.GetHostEntry(addr) I get No such host is known?

I am new to networking, so sorry if this is an obtuse question. I am attempting to communicate with a unit (device) on a network, but can’t. I am using .NET 2015 v4.8. I need to communicate tcp v1.3. I am on a windows 11 pc. In my code I am able to ping the unit, but cannot connect. I get the error below:
Error Message
WireShark tells me I’m seeking the wrong port.
WireShark Activity
What am I doing wrong?

Why is port number given when doing a DNS lookup?

In ASIO C++ networking library you can resolve an address by creating a query object, whose constructor takes (optionally whether it’s ip4 or ip6), a “host” argument and a “service” argument. The “host” is the name of the site you want to resolve to an IP number, and the “service” (I’m guessing) is the port number. So this does a DNS lookup/request, but my understanding is that DNS queries are for looking up associations between names and IP numbers, I don’t see how the port figures into this at all.