summaryrefslogtreecommitdiff
path: root/docs/server/ddns.md
blob: f81f5d747cfd013aa17187c1f210033c7b9c8cc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# DDNS Setup

## Porkbun API

Follow this [porkbun](https://kb.porkbun.com/article/190-getting-started-with-the-porkbun-api) guide on enabling the api for your domain.

## ddns-updater

[ddns-updater](https://github.com/qdm12/ddns-updater) is the program used to update Porkbun's A record of your domain.

### Docker install

Install the [docker](https://docs.docker.com/engine/install/debian/) package from official docker repositories.

### Setup

Create a directory with config.json inside, and make sure that its owner has a uid of 1000.

	mkdir data
	touch data/config.json
	# Owned by user ID of Docker container (1000)
	chown -R 1000 data
	# all access (for creating json database file data/updates.json)
	chmod 700 data
	# read access only
	chmod 400 data/config.json

Configuration for porkbun in config.json

	{
	  "settings": [
	    {
	      "provider": "porkbun",
	      "domain": "domain.com",
	      "host": "@",
	      "api_key": "PORKBUN SECRET KEY",
	      "secret_api_key": "PORKBUN API KEY",
	      "ip_version": "ipv4"
	    }
	  ]
	}
	
Optional `"ttl"` paramter specifing A record TTL not included.

### Usage
	docker run -d -p 8000:8000/tcp -v "$(pwd)"/data:/updater/data qmcgaw/ddns-updater
	
This will start a docker container that will start updating the DNS records.
Status updates can be seen in a web server by going to localhost:8000.