Skip to content

Commit 83bfebc

Browse files
committed
adds debugging to dnsserver
1 parent 7fa8caf commit 83bfebc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

libraries/DNSServer/src/DNSServer.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
#include <lwip/def.h>
33
#include <Arduino.h>
44

5+
// #define DEBUG_ESP_DNS
6+
#ifdef DEBUG_ESP_PORT
7+
#define DEBUG_OUTPUT DEBUG_ESP_PORT
8+
#else
9+
#define DEBUG_OUTPUT Serial
10+
#endif
511

612
DNSServer::DNSServer()
713
{
@@ -132,6 +138,11 @@ void DNSServer::replyWithIP()
132138
_udp.write((uint8_t)4);
133139
_udp.write(_resolvedIP, 4);
134140
_udp.endPacket();
141+
142+
#ifdef DEBUG_ESP_DNS
143+
DEBUG_OUTPUT.printf("DNS responds: %s for %s\n",
144+
IPAddress(_resolvedIP).toString().c_str(), getDomainNameWithoutWwwPrefix().c_str() );
145+
#endif
135146
}
136147

137148
void DNSServer::replyWithCustomCode()

0 commit comments

Comments
 (0)