Skip to content

Infrastructure with NGINX PDNS and MYSQL for pdns backend

Notifications You must be signed in to change notification settings

ThibaultRiviere/nginx-pdns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NGINX PDNS

NGINX and PowerDNS running on Docker with MySQL backend.

Build and start services

docker-compose stop
docker-compose rm
docker-compose build
docker-compose up

DNS setup

See here for more information.

Create the first domain

export DOMAIN=mondomain.com
export IP=127.0.0.1
curl -X POST --data '{"name":"$DOMAIN", "kind": "Native", "masters": [], "nameservers": ["ns1.$DOMAIN", "ns2.$DOMAIN"]}' -v -H 'X-API-Key: changeme' $IP:8001/servers/localhost/zones
curl -X PATCH --data '{"rrsets": [ {"name": "$DOMAIN", "type": "A", "changetype": "REPLACE", "records": [ {"content": "$IP", "disabled": false, "name": "$DOMAIN", "ttl": 86400, "type": "A", "priority": 0 } ] } ] }' -H 'X-API-Key: changeme' $IP:8001/servers/localhost/zones/$DOMAIN

Create a subdomain

export DOMAIN=mondomain.com
export SUBDOMAIN=s3.mondomain.com
export IP=127.0.0.1
curl -X PATCH --data '{"rrsets": [ {"name": "$SUBDOMAIN", "type": "CNAME", "changetype": "REPLACE", "records": [ {"content": "$DOMAIN", "disabled": false, "name":"$SUBDOMAIN", "ttl": 86400, "type": "CNAME", "priority": 0 } ] } ] }' -H 'X-API-Key: changeme' $IP:8001/servers/localhost/zones/$DOMAIN

Dig the domain

dig example.local @$IP

NGINX Configuration

All the file in the nginx/conf with the extension .conf will be load See configuration here

If you want to use https maybe you should take a look here

About

Infrastructure with NGINX PDNS and MYSQL for pdns backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages