Installation and Setup

This guide covers how to install and set up nx9-dns-server for your environment.

Prerequisites

Before installing nx9-dns-server, ensure you have the following:

  • Rust toolchain (latest stable version recommended)
  • SQLite development libraries
  • For DNSSEC: BIND's dnssec-keygen tool (optional but recommended)
  • For deployment: systemd (for traditional deployment) or Docker (for containerized deployment)

Installation Methods

Method 1: Build from Source

  1. Clone the repository: bash git clone https://github.com/thakares/nx9-dns-server.git cd nx9-dns-server

  2. Build the project: bash cargo build --release

  3. The compiled binary will be located at target/release/dns_server

Method 2: Docker Deployment

See the [Deployment Options]page for Docker installation instructions.

Initial Setup

1. Create a DNS Records Database

Create an SQLite database with the required schema:

```bash

Create a new SQLite database

sqlite3 dns.db < conf/dns_records.sql

Or use the sample database

cp conf/dns.db.sample dns.db ```

2. Configure Environment Variables

Set up the following environment variables:

bash export DNS_BIND="0.0.0.0:53" export DNS_DB_PATH="/path/to/dns.db" export DNSSEC_KEY_FILE="/path/to/Kanydomain.tld.key" # If using DNSSEC export DNS_FORWARDERS="8.8.8.8:53,1.1.1.1:53" export DNS_NS_RECORDS="ns1.anydomain.tld.,ns2.anydomain.tld."

3. Run the Server

```bash

Manual execution

./dns_server

Or for systemd-based deployment

sudo cp dns_server /usr/local/bin/ sudo cp conf/dns-server.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now dns-server.service ```

4. Verify Installation

Use the provided diagnostic script to verify the installation:

bash bash scripts/dnscheck.sh

This will run a series of DNS queries against your server to ensure it's responding correctly.

Setup for DNSSEC (Optional)

If you want to enable DNSSEC, follow these steps:

  1. Install BIND's dnssec-keygen tool: bash sudo apt-get install bind9-dnsutils # Debian/Ubuntu # or sudo yum install bind-utils # CentOS/RHEL

  2. Generate a DNSSEC key pair: bash dnssec-keygen -a RSASHA256 -b 2048 -n ZONE yourdomain.tld

  3. Set up the DNSSEC_KEY_FILE environment variable to point to the generated public key: bash export DNSSEC_KEY_FILE="/path/to/Kyourdomain.tld.+008+24550.key"

For more details on DNSSEC setup, see the [DNSSEC Implementation] page.

Next Steps

After installation, you might want to:

  1. Add or modify DNS records in the database
  2. Configure the Web UI (coming soon)
  3. Set up API access (coming soon)
  4. Create user accounts (coming soon)

See the [DNS Record Management] page for information on managing DNS records.