Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.64 KB

README.md

File metadata and controls

51 lines (33 loc) · 1.64 KB

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