This is a DDNS (Dynamic DNS) tool to update your domain with your router current IP. The project has two components:
- The server, which gets the IP from headers, check if it has changed (based on last_ip query parameter) and set the Route53 domain record pointing to the IP.
- The client, which periodically calls the server with the last_ip query parameter and set it with the response.
The server is a AWS lambda function created with serverless framework. To deploy it some env variables should be set and then the deploy command should be run:
cd lambda
export HOSTED_ZONE_ID=<YOUR HOSTED ZONE ID>
export RECORD_NAME=<YOUR RECORD NAME: foo.example.com>
serverless deploy --stage pro --env production
WARNING: AWS user has to be logged-in on the system and the user need the required permissions to deploy with serverless framework.
The result of the deploy command will return a URL and an API key that should be saved to configure the client.
The client is a bash script. Additional files are provided to configure systemctl service and timer. The client could be configured in something like a Raspberry PI that is always running.
Follow the next steps to configure the client:
- Replace <API_KEY> and <URL> from client/ddns-aws-client.service.
- Move client/ddns-aws-client.sh to /usr/bin/.
- Move client/ddns-aws-client.service and client/ddns-aws-client.timer to /etc/systemd/system/.
sudo systemctl disable ddns-aws-client
sudo systemctl enable ddns-aws-client.timer
It can be checked that the timer is running with command: sudo systemctl status ddns-aws-client
.
Run client executing the following command:
docker run rogelioo/ddns-aws-client:latest -v /tmp/ddns_cache/:/tmp/ddns_cache/ --api-key <API_KEY> --url <URL>
Replace <API_URL>
from client/k8s.yaml
, create PVC ddns-aws-client
with 500Ki, and run the following command:
kubectl apply -f client/k8s.yaml