This is a simple DNS server written in Node.js. It is intended to be used as a local DNS for your network. It is not a full DNS server, but it is capable of resolving a few basic DNS queries (A, AAAA, CNAME, PTR, TXT, and MX). It is also capable of forwarding queries to another DNS service (such as your ISP's DNS). It is not intended to be used as a public DNS.
To install the DNS server, you must first install Node.js. You can download Node.js from nodejs.org. Once Node.js is installed, clone the repo.
The DNS is capable of resolving a few basic DNS queries (A, AAAA, CNAME, PTR, TXT, and MX). It is also capable of forwarding queries to another DNS (such as your ISP's DNS). It is not intended to be used as a public DNS This server currently handles DNS headers and questions, with a focus on:
- Header Parsing:
- Extracts the ID, QR, Opcode, AA, TC, RD, RA, Z, RCODE, QDCOUNT, ANCOUNT, NSCOUNT, and ARCOUNT fields from the header.
- Constructs DNS response headers and question sections
- Question Parsing:
- Extracts the QNAME, QTYPE, and QCLASS fields from the question.
- Constructs DNS response resource records
- Resource Record Parsing:
- Extracts the NAME, TYPE, CLASS, TTL, RDLENGTH, and RDATA fields from the resource record.
- Constructs DNS response resource records
- DNS Response:
- Constructs DNS response headers and question sections
- Constructs DNS response resource records
- Compressed Packet Handling:
- The DNS server does not currently handle compressed packets.
- Answering capabilities:
- It is not a full DNS, but it is capable of resolving a few basic DNS queries (A, AAAA, CNAME, PTR, TXT, and MX).
- Response:
- it only handles the answer section of the response, and does not handle the authority or additional sections.
To test the DNS server, you can use the dig
or nslookup
command
Refer to this document detailing the specifications and implementation of Domain names and DNS:
- Compressed Packet Handling:
- Expand answer handling capabilities to support more record types and custom response.
- Add support for authority and additional records sections.