This guide provides Ansible playbooks to install MaraDNS. Due to package availability issues and security concerns with distribution packages, source build is recommended for production deployments.
⚠️ Package Warning: Debian/Ubuntu packages contain vulnerable MaraDNS 2.0.13. Fedora packages (3.5.0036) are secure. For Debian/Ubuntu/RHEL, use the source build playbook below.
Installs MaraDNS 3.5.0036 from source on any Linux distribution:
- name: Install MaraDNS from source
hosts: maradns
become: true
vars:
maradns_version: "3.5.0036"
maradns_url: "https://maradns.samiam.org/download/3.5"
tasks:
- name: Install build dependencies
package:
name:
- gcc
- make
- wget
state: present
- name: Download MaraDNS source
get_url:
url: "{{ maradns_url }}/maradns-{{ maradns_version }}.tar.xz"
dest: "/tmp/maradns-{{ maradns_version }}.tar.xz"
mode: "0644"
register: download_result
- name: Extract source
unarchive:
src: "/tmp/maradns-{{ maradns_version }}.tar.xz"
dest: /tmp
remote_src: true
when: download_result.changed
- name: Compile MaraDNS
command: ./configure
args:
chdir: "/tmp/maradns-{{ maradns_version }}"
when: download_result.changed
- name: Build binaries
command: make
args:
chdir: "/tmp/maradns-{{ maradns_version }}"
when: download_result.changed
- name: Install binaries
command: make install
args:
chdir: "/tmp/maradns-{{ maradns_version }}"
when: download_result.changed
- name: Create configuration directory
file:
path: /etc/maradns
state: directory
mode: "0755"
- name: Verify installation
command: maradns --version
register: maradns_version_check
changed_when: false
- name: Show installed version
debug:
var: maradns_version_check.stdout
For Fedora systems only (secure package version):
- name: Install MaraDNS on Fedora
hosts: maradns
become: true
tasks:
- name: Install MaraDNS package
dnf:
name: maradns
state: present
- name: Enable and start service
service:
name: maradns
state: started
enabled: true
- name: Verify installation
command: maradns --version
register: maradns_version_check
changed_when: false
- name: Show installed version
debug:
var: maradns_version_check.stdout
/etc/mararc (source build and Fedora)We develop tailored automation solutions for:
Let’s discuss your requirements: office@linux-server-admin.com | Contact