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:
- Clone the repository:
git clone https://git.rznet.fr/razian/rdns-authoritative
- Navigate to the project directory:
cd rdns-authoritative
- Build the project using the
go buildcommand:
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:
-
Make sure you have Docker and Docker Compose installed on your system.
-
Navigate to the project directory containing the
docker-compose.ymlfile. -
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:
-
Open the
config.ymlfile in a text editor. -
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
...
-
Save the
config.ymlfile. -
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.