File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -123,10 +123,21 @@ void DNSServer::replyWithIP()
123
123
if (_buffer == NULL ) return ;
124
124
_dnsHeader->QR = DNS_QR_RESPONSE;
125
125
_dnsHeader->ANCount = _dnsHeader->QDCount ;
126
- _dnsHeader->QDCount = 0 ;
126
+ _dnsHeader->QDCount = _dnsHeader->QDCount ;
127
+ // _dnsHeader->QDCount = 0;
127
128
128
129
_udp.beginPacket (_udp.remoteIP (), _udp.remotePort ());
129
130
_udp.write (_buffer, _currentPacketSize);
131
+
132
+ _udp.write ((uint8_t )192 ); // answer name is a pointer
133
+ _udp.write ((uint8_t )12 ); // pointer to offset at 0x00c
134
+
135
+ _udp.write ((uint8_t )0 ); // 0x0001 answer is type A query (host address)
136
+ _udp.write ((uint8_t )1 );
137
+
138
+ _udp.write ((uint8_t )0 ); // 0x0001 answer is class IN (internet address)
139
+ _udp.write ((uint8_t )1 );
140
+
130
141
_udp.write ((unsigned char *)&_ttl, 4 );
131
142
_udp.write ((uint8_t )0 );
132
143
_udp.write ((uint8_t )4 );
You can’t perform that action at this time.
0 commit comments