Git Product home page Git Product logo

xip-pdns's Introduction

XIP PowerDNS Backend Adapter

This is the source of the PowerDNS pipe backend adapter powering xip.io.

Deploying Manually

Copy etc/xip-pdns.conf.example to /etc/xip-pdns.conf, and modify to meet your needs.

Example:

/etc/xip-pdns.conf

# Increment this timestamp when the contents of the file change.
XIP_TIMESTAMP="2014102800"

# The top-level domain for which the name server is authoritative.
XIP_DOMAIN="xip.test"

# The public IP addresses (e.g. for the web site) of the top-level domain.
# `A` queries for the top-level domain will return this list of addresses.
XIP_ROOT_ADDRESSES=( "1.2.3.1" )

# The public IP addresses on which this xip-pdns server will run.
# `NS` queries for the top-level domain will return this list of addresses.
# Each entry maps to a 1-based subdomain of the format `ns-1`, `ns-2`, etc.
# `A` queries for these subdomains map to the corresponding addresses here.
XIP_NS_ADDRESSES=( "1.2.3.4" "1.2.3.5" )

# How long responses should be cached, in seconds.
XIP_TTL=300

Then copy etc/xip-pdns.backend.conf.example to /etc/powerdns/pdns.d/xip.conf (or the appropriate PowerDNS backend adapter configuration location for your system), and modify to meet your needs.

Example:

/etc/powerdns/pdns.d/xip.conf

launch=pipe
pipe-command=/usr/local/bin/xip-pdns /etc/xip-pdns.conf

Finally, copy bin/xip-pdns to /usr/local/bin/xip-pdns (or wherever you prefer).

Restart PowerDNS, and test.

$ dig test-10-0-0-1.xip.test @localhost
;; ANSWER SECTION:
test.10.0.0.1.xip.test. 300     IN      A       10.0.0.1

Note: Replace localhost with the address of the host running PowerDNS.

Deploying with Docker

XIP PDNS can easily be deployed with the included Dockerfile as follows.
First copy etc/xip-pdns.conf.example to /path/to/xip-pdns.conf (wherever you want it), and modify for your needs. Build, and run with Docker:

$ cp -a etc/xip-pdns.conf.example etc/xip-pdns.conf

$ docker build -t 'xip-pdns' .

$ docker run -it \
    -p 0.0.0.0:53:53/tcp \
    -p 0.0.0.0:53:53/udp \
    -v ./etc/xip-pdns.conf:/etc/xip-pdns.conf \
    xip-pdns

Alternatively, the above can be run with Docker Compose using the included docker-compose.yml:

$ docker-compose up

And test:

$ dig test-10-0-0-1.xip.test @localhost
;; ANSWER SECTION:
test.10.0.0.1.xip.test. 300     IN      A       10.0.0.1

Note: Replace localhost with the host running the Docker container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.