Difference between revisions of "SlimDNS"

From ArchWiki
Jump to: navigation, search
(flag for style)
(Some style fix.)
Line 6: Line 6:
 
{{Related articles end}}
 
{{Related articles end}}
 
{{Style|Many [[Help:Style]] issues}}
 
{{Style|Many [[Help:Style]] issues}}
[https://github.com/Torxed/slimDNS slimDNS] is a simple DNS server. It's purpose is to be a self-contained, slim and uncomplicated executable.<br>
+
[https://github.com/Torxed/slimDNS slimDNS] is a simple DNS server. It's purpose is to be a self-contained, slim and uncomplicated executable.
 +
 
 
It relies on [[PostgreSQL]] for its zone and record information.
 
It relies on [[PostgreSQL]] for its zone and record information.
  
== Installing slimDNS ==
+
== Installation ==
  
 
Install {{AUR|slimDNS-git}} or clone [https://github.com/Torxed/slimDNS.git github.com/Torxed/slimDNS] and follow the manual setup instructions.
 
Install {{AUR|slimDNS-git}} or clone [https://github.com/Torxed/slimDNS.git github.com/Torxed/slimDNS] and follow the manual setup instructions.
Line 17: Line 18:
 
Create a user/role called "slimdns"
 
Create a user/role called "slimdns"
  
    [postgres@machine~] createuser --interactive
+
[postgres@machine~] createuser --interactive
    [postgres@machine~] psql
+
[postgres@machine~] psql
    > CREATE DATABASE slimdns OWNER slimdns;
+
> CREATE DATABASE slimdns OWNER slimdns;
    > ALTER USER slimdns WITH PASSWORD '<some secure random string>';
+
> ALTER USER slimdns WITH PASSWORD '<some secure random string>';
  
 
== Running ==
 
== Running ==
  
As root, [[start]] and [[enable]] {{ic|slimDNS.service}}.<br>
+
[[start]] and [[enable]] {{ic|slimDNS.service}}.
Or if preferred, running it manually is done by simply invoking the main script:
+
 
 +
Or if preferred, running it manually:
  
    [user@machine~] sudo python slimdns.py
+
# python slimdns.py
  
 
== Configuration ==
 
== Configuration ==
  
Configuration is stored under `/etc/slimDNS/config.py`, any changes to the config requires a restart.
+
Configuration is stored under {{ic|/etc/slimDNS/config.py}}, any changes to the config requires a restart.
  
 
SlimDNS comes with a tool to modify the database, it's called `dnstools` (subject to name change).
 
SlimDNS comes with a tool to modify the database, it's called `dnstools` (subject to name change).
Line 40: Line 42:
 
=== Adding a domain ''(optional)'' ===
 
=== Adding a domain ''(optional)'' ===
  
    [user@machine~] python dnstool.py example.com
+
# python dnstool.py example.com
  
 
=== Adding a `A` record ===
 
=== Adding a `A` record ===
  
    [user@machine~] python dnstool.py example.com 46.21.102.81
+
# python dnstool.py example.com 46.21.102.81
  
 
{{Note|Again, if the domain `example.com` didn't exist, a domain entry would be inserted and appropriate SOA and NS records will be inserted as well for this new domain.}}
 
{{Note|Again, if the domain `example.com` didn't exist, a domain entry would be inserted and appropriate SOA and NS records will be inserted as well for this new domain.}}
Line 50: Line 52:
 
You can also add the same record, but define the record type:
 
You can also add the same record, but define the record type:
  
    [user@machine~] python dnstool.py example.com 46.21.102.81 A
+
# python dnstool.py example.com 46.21.102.81 A
  
 
=== Adding a MX record / complex records ===
 
=== Adding a MX record / complex records ===
Line 57: Line 59:
 
In order to be generic in handling these records, enclose the content of the record and add all the necessary data needed for the desired record type.
 
In order to be generic in handling these records, enclose the content of the record and add all the necessary data needed for the desired record type.
  
    [user@machine~] python dnstool.py example.com "46.21.102.81 10" MX
+
# python dnstool.py example.com "46.21.102.81 10" MX
  
 
This would create a MX record, with a priority or preference of 10.
 
This would create a MX record, with a priority or preference of 10.

Revision as of 05:53, 26 January 2018

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Many Help:Style issues (Discuss in Talk:SlimDNS#)

slimDNS is a simple DNS server. It's purpose is to be a self-contained, slim and uncomplicated executable.

It relies on PostgreSQL for its zone and record information.

Installation

Install slimDNS-gitAUR or clone github.com/Torxed/slimDNS and follow the manual setup instructions.

Manual setup (optional)

Create a user/role called "slimdns"

[postgres@machine~] createuser --interactive
[postgres@machine~] psql
> CREATE DATABASE slimdns OWNER slimdns;
> ALTER USER slimdns WITH PASSWORD '<some secure random string>';

Running

start and enable slimDNS.service.

Or if preferred, running it manually:

# python slimdns.py

Configuration

Configuration is stored under /etc/slimDNS/config.py, any changes to the config requires a restart.

SlimDNS comes with a tool to modify the database, it's called `dnstools` (subject to name change). The tool takes a series of parameters in order and can create domains (zones) and records.

Note: Creating a domain, will not set up SOA or NS records by default. However, creating a record will automatically set up a SOA and NS record if the specified domain is not found.

Adding a domain (optional)

# python dnstool.py example.com

Adding a `A` record

# python dnstool.py example.com 46.21.102.81
Note: Again, if the domain `example.com` didn't exist, a domain entry would be inserted and appropriate SOA and NS records will be inserted as well for this new domain.

You can also add the same record, but define the record type:

# python dnstool.py example.com 46.21.102.81 A

Adding a MX record / complex records

Some records have more complex structure, for instance the SRV, MX or TXT records. In order to be generic in handling these records, enclose the content of the record and add all the necessary data needed for the desired record type.

# python dnstool.py example.com "46.21.102.81 10" MX

This would create a MX record, with a priority or preference of 10.

Handy information

  • Updates run time cache every 30 seconds.
  • Does support a forwarding DNS server, however, testing on this is limited
  • Upon each start, slimdns will attempt to create the database 'slimdns' if not found, but will need this optional permissions to work.
  • Might crash for no aparent reason :D