Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DNS Server Refusing Connection

Tags:

dns

udp

I am implementing a dns client, in which i try to connect to a local dns server, but the dns server is returning the message with an error code 5 , which means that its refusing the connection.

Any thoughts on why this might be happening ?? Thanks


1 Answers

DNS response error code 5 ("Refused") doesn't mean that the connection to the DNS server is refused. It means that the DNS server refuses to provide whatever data you asked for, or to do whatever action you asked it to do (for example a dynamic update).

Since you mention a "connection", I assume that you are using TCP? DNS primarilly uses UDP, and some DNS servers will refuse all requests over TCP. So the solution might be as simple as switching to UDP.

Otherwise, assuming you are building your own DNS client from scratch, my first guess would be that you are formatting the request incorrectly. Eventhough the DNS protocol seems fairly simple, it is very easy to get this wrong.

Finally, the DNS server may of course simply be configured to refuse requests for whatever you are asking.

like image 70
Jesper Avatar answered Feb 18 '26 00:02

Jesper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!