DNS: Domain Name System

https://en.m.wikipedia.org/wiki/Domain_Name_System

Server API

enum class DnsReplyCode

Values:

enumerator NoError
enumerator FormError
enumerator ServerFailure
enumerator NonExistentDomain
enumerator NotImplemented
enumerator Refused
enumerator YXDomain
enumerator YXRRSet
enumerator NXRRSet
DNS_QR_QUERY
DNS_QR_RESPONSE
DNS_OPCODE_QUERY
struct DnsHeader
#include <DnsServer.h>
class DnsServer : public UdpConnection
#include <DnsServer.h>

DNS server class.

Public Functions

inline void setErrorReplyCode(DnsReplyCode replyCode)

Set error reply code.

inline void setTTL(uint32_t ttl)

Set message Time-To-Live in seconds.

bool start(uint16_t port, const String &domainName, const IpAddress &resolvedIP)

Start the DNS server.

Parameters:
  • port

  • domainName

  • resolvedIP

Return values:

bool – true if successful, false if there are no sockets available.

inline void stop()

Stop the DNS server.