Skip to main content

Application keep DNS records updated when external IP-address change

Project description

Loopia update ip

Utility to keep your domains pointing to the current external IP-adress using the Loopia-API to update your adresses.

Preferred usage

The preferred way to run this service is a Docker container with the configuration provided as a docker-compose file.

Create an API-key in the LoopiaAPI control panel

Required privileges:

  • addSubdomain
  • removeZoneRecord
  • updateZoneRecord
  • addZoneRecord
  • getSubdomains
  • getZoneRecords
  • removeSubdomain

Create the following file structure


loopia-update-ip
   ├──\ config
   │    ├── config.yaml
   ├──\ logs
   ├── docker-compose.yaml

Docker compose file: docker-compose.yaml

version: '3.8'

services:
  ftp:
    image: registry.gitlab.com/niklasme/loopia-update-ip
    container_name: loopia-update-ip
    volumes:
      - ./config:/config
      - ./logs:/logs
    restart: unless-stopped

Service configuration file: config.yaml

credentials:
    loopia_username: xyz@loopiaapi
    loopia_password: abc
domains:
  'mydomain.com':
    sub_domains:
      - www
      - video
    ttl: 3600

Start Docker container service

docker compose up

Verify that no errors are thrown and that your credentials are accepted. Press Ctrl-C to stop the service and relaunch in detached mode.

docker compose up -d

You can always check logs in the output file:

cat ./logs/loopia_update_ip.log

or by ouputing the logs from the Docker container

#> docker ps
CONTAINER ID   IMAGE                                           COMMAND                  CREATED          STATUS                 PORTS                                                                                      NAMES  
fc1a6ff4debd   registry.gitlab.com/niklasme/loopia-update-ip   "loopia-update-ip-se…"   10 minutes ago   Up 9 minutes                                                                                                      loopia-update-ip

#> docker logs fc1a6ff4debd

Example of log output:

 Starting service
 Logging to: /logs/loopia_update_ip.log
 Docker configuration file found!
 Domain: www.mydomain.com: Zone record 123.123.123.123 - External IP 123.123.123.123
	 No update required!
 Domain: video.mydomain.com: Zone record 123.123.123.123 - External IP 123.123.123.123
	 No update required!
 Domain: ftp.mydomain.com: Zone record 123.123.123.123 - External IP 123.123.123.123
	 No update required!
 Domain: docs.mydomain.com: Zone record 213.213.213.213 - External IP 123.123.123.123

 Updating zone record to 123.123.123.123 for docs.mydomain.com
 Domain: security.mydomain.com: Zone record 123.123.123.123 - External IP 123.123.123.123
	 No update required!
2024-03-30 17:14:37,637 - root - INFO - External IP-address is still 123.123.123.123
2024-03-30 17:14:55,707 - root - INFO - External IP-address is still 123.123.123.123
2024-03-30 17:15:13,765 - root - INFO - External IP-address is still 123.123.123.123

Development only

Build Docker image locally

docker build -t loopia-update-ip
docker compose up

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loopia_update_ip-0.4.1.tar.gz (21.4 kB view hashes)

Uploaded Source

Built Distribution

loopia_update_ip-0.4.1-py3-none-any.whl (21.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page