Sign inSign up

hybridadmin/pdns-recursor

By hybridadmin

Updated 11 months ago

PowerDNS Recursor is a high-performance DNS recursor with built-in scripting capabilities

Image
0

2.2K

hybridadmin/pdns-recursor repository overview

PowerDNS Recursor Docker Image

build_push Docker Pulls

What is PowerDNS Recursor?

PowerDNS Recursor is a high-performance DNS recursor with built-in scripting capabilities.

Usage

docker-compose
---
version: "3.2"
services:
  pdns-recursor:
    image: hybridadmin/pdns-recursor:latest
    container_name: pdns-recursor-server
    hostname: pdns-recursor-server #optional
    environment:
      - USER_ID=daemon
      - GROUP_ID=daemon
      - SERVER_ID=disabled
      - DNSSEC_MODE=process-no-validate
      - LOCAL_ADDRESS=0.0.0.0
      - MAX_CACHE_TTL=28800
      - MAX_NEGATIVE_TTL=3600
      - PACKETCACHE_TTL=3600
      - GETTAG_NEEDS_EDNS_OPTIONS=no
      - USE_INCOMING_EDNS_SUBNET=no
      - ANY_TO_TCP=yes
    ports:
      - 53:53/tcp
      - 53:53/udp
    restart: always
docker cli

Run a container with default settings:

docker run -d -p 53:53/udp -p 53:53/tcp --restart=always hybridadmin/pdns-recursor:latest

To run a container with customized settings:

docker run -d --name tester_dns \
-e USER_ID=daemon #optional \
-e GROUP_ID=daemon #optional \
-e SERVER_ID=disabled \
-e DNSSEC_MODE=process-no-validate \
-e LOCAL_ADDRESS=0.0.0.0 #optional \
-e MAX_CACHE_TTL=28800 #optional \
-e MAX_NEGATIVE_TTL=3600 #optional \
-e PACKETCACHE_TTL=3600 #optional \
-e GETTAG_NEEDS_EDNS_OPTIONS=no #optional \
-e USE_INCOMING_EDNS_SUBNET=no #optional \
-e ANY_TO_TCP=yes #optional \
-p 53:53/udp -p 53:53/tcp -p 8081:8081/tcp --restart=always hybridadmin/pdns-recursor:latest

Connect to the container:

docker exec -it [container_id] /bin/bash
Configuration Settings

By default, the settings below have been configured in /etc/powerdns/recursor.conf via the script docker-entrypoint.sh inside the container.

Example recursor.conf:

    local-address=0.0.0.0
    allow-from=0.0.0.0/0
    version-string=Not Supported
    setuid=daemon
    setgid=daemon
    max-cache-ttl=28800
    max-negative-ttl=3600
    packetcache-ttl=3600
    gettag-needs-edns-options=yes
    use-incoming-edns-subnet=yes
    any-to-tcp=yes
    reuseport=yes
    socket-dir=/var/run

Additional settings from the official configuration documentation can be added as well if needed.

Environment Variables

VariableFunction
USER_IDUser to change to after binding to socket
GROUP_IDGroup to change to after binding to socket
SERVER_IDThe reply given by The PowerDNS recursor to a query for ‘id.server’
DNSSEC_MODESet the mode for DNSSEC processing, more info
LOCAL_ADDRESSLocal IP address(es) to bind to
MAX_CACHE_TTLMaximum number of seconds to cache an item in the DNS cache
MAX_NEGATIVE_TTLMaximum amount of time negative entries are cached
PACKETCACHE_TTLMaximum number of seconds to cache an item in the packet cache
GETTAG_NEEDS_EDNS_OPTIONSSpecify whether to extract and pass EDNS options in incoming queries
USE_INCOMING_EDNS_SUBNETSpecify whether to process and pass along a received EDNS Client Subnet to authoritative servers
ANY_TO_TCPAnswer questions for the ANY type on UDP with a truncated packet that refers the remote server to TCP

Tag summary

Content type

Image

Digest

sha256:46794d070

Size

63.5 MB

Last updated

11 months ago

docker pull hybridadmin/pdns-recursor