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

101 lines
3.0 KiB
Markdown

# 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](#requirements)
- [Building the Project](#building-the-project)
- [Running with Docker Compose](#running-with-docker-compose)
- [Configuring Zones](#configuring-zones)
## 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:
```bash
git clone https://git.rznet.fr/razian/rdns-authoritative
```
2. Navigate to the project directory:
```bash
cd rdns-authoritative
```
3. 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:
```bash
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:
```yaml
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
...
```
3. Save the `config.yml` file.
4. 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](https://github.com/miekg/dns) and [prometheus/client_golang](https://github.com/prometheus/client_golang)
## License
tbin is licensed under the MIT License. See the [LICENSE](https://git.rznet.fr/razian/rdns-authoritative/src/branch/main/LICENSE) file for more information.