No description
Find a file
2023-04-18 11:01:56 -04:00
service makefile install and uninstall, use different config path 2023-04-12 11:56:55 -04:00
src bugs 2023-04-18 11:01:56 -04:00
.gitignore finalize cmd record 2023-04-11 15:05:49 -04:00
buffer.c bugs 2023-04-18 11:01:56 -04:00
LICENSE gpl 2023-03-01 01:12:59 -05:00
Makefile fix makefile 2023-04-13 18:32:44 -04:00
readme.md more posix support stuff 2023-04-13 12:46:30 -04:00

Wrapper

A simple and lightweight dns server written in C

How to

Wrapper by default runs on port 53 udp and tcp, which is the default port for DNS. If you wish to change this variable, set the PORT environment variable is set to a different port number.

To set custom records, wrapper reads configuration from /etc/wrapper.conf, and if that doesn't exist, ./config.

The config file format is a question on its own line, then followed by records on their own line. To separate questions/records from each other, place a extra empty new line between them. For example...

IN A google.com
IN A 300 12.34.56.78 

IN TXT joe
IN TXT 60 biden

Question

Now to break this down piece by piece, the question is made up of a class, record type, and domain. Domain is self explanitory, but for the other two:

Class

The valid classes are IN (Internet), CH (Chaosnet), and HS (Hesiod). For most purposes your going to be using IN.

Record type

The current supported record types are A, NS, CNAME, SOA, PTR, MX, TXT, AAAA, SRV, and CAA.

Answer

Answers are very similar to questions, they have a class, record type, but also have a Time to Live (TTL), and its record data. TTL is just the amount of seconds other DNS servers should cache the value, but for record data, it's formatted as such:

Record Data

  • A ipv4 (0.0.0.0)
  • NS, CNAME, PTR domain (google.com)
  • SOA mname, nname serial refresh retry expire minimum (ns1.google.com. dns-admin.google.com. 523655285 900 900 1800 60)
  • MX: priority domain (10 smtp.google.com)
  • TXT: text (Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua)
  • AAAA ipv6 (2607:f8b0:4006:080c:0000:0000:0000:200e::)
  • SRV priority weight port domain (10 10 10 example.com)
  • CAA flags tag value (0 issue "pki.goog")

Wrapper also has a few joke/meme records for fun. Note these should never acutaly be used for general use, but they are funny.

  • AR, AAAAR
  • CMD command (neofetch)

AR and AAAAR have no record data since they generate ipv4's and ipv6's respectively, and turn into A and AAAA upon response to sender

CMD runs the command supplied on the host system and returns the std output as a TXT record

License

This project is Licensed under the GPLv3

Compilation

Wrapper only runs on Linux systems that are Posix 1995 compliant

Make sure to have gcc and make installed, and then run

$ make # compiles the program
$ sudo make install # installs the binary

If you are running openrc, there is a premade service file so you can run

$ sudo make install-openrc # installs the binary and service file 

If you wish to remove the program, you can run

$ sudo make uninstall # removes the binary

Or again if your running openrc

$ sudo make uninstall-openrc # removes the binary and service file