Files
2023-06-30 16:09:27 +02:00

3.0 KiB

rdns-authoritative

rdns-authoritative is a DNS server that acts as an authoritative server for a specific set of domains. It reads the zone configurations from a YAML file and responds to DNS queries based on the defined records.

Table of Contents

Requirements

  • Go (version 1.16 or higher)
  • Docker (optional)

Building the Project

To build the rdns-authoritative project, follow these steps:

  1. Clone the repository:
git clone https://git.rznet.fr/razian/rdns-authoritative
  1. Navigate to the project directory:
cd rdns-authoritative
  1. Build the project using the go build command:
go build -o rdns-authoritative .

This will generate an executable binary named rdns-authoritative in the current directory.

Running with Docker Compose

The project includes a docker-compose.yml file that simplifies the process of running the rdns-authoritative server using Docker.

To run the server with Docker Compose, follow these steps:

  1. Make sure you have Docker and Docker Compose installed on your system.

  2. Navigate to the project directory containing the docker-compose.yml file.

  3. Start the server using Docker Compose:

docker-compose up -d

The rdns-authoritative server will be accessible on port 53 for DNS queries and port 9153 for Prometheus metrics.

Configuring Zones

The rdns-authoritative server uses a YAML file to define the zones and their corresponding records. The default configuration file is config.yml.

To configure the zones, follow these steps:

  1. Open the config.yml file in a text editor.

  2. Define the zones and their records using the following format:

domains:
  - domain: rznet.fr                # Domain name
    ttl: 3600                       # Time to Live for the domain
    records:                        # List of records for the domain
      - name: rznet.fr              # Record name
        type: SOA                   # Record type (SOA, NS, A, CNAME, etc.)
        data:                       # Record data
          - ns1.rznet.fr. rznet.fr. 1638025340 86400 3600 3600000 3600
      - name: rznet.fr
        type: NS
        data:
          - ns1.rznet.fr
          - ns2.rznet.fr
      ...
  1. Save the config.yml file.

  2. Restart the rdns-authoritative server if it is already running.

The server will now respond to DNS queries based on the defined zone configurations.

That's it! You have successfully built and configured the rdns-authoritative server. Now you can handle authoritative DNS queries for the defined zones.

Acknowledgments

This project uses code from miekg/dns and prometheus/client_golang

License

tbin is licensed under the MIT License. See the LICENSE file for more information.