All Projects → stecklars → dynamic-dns-netcup-api

stecklars / dynamic-dns-netcup-api

Licence: MIT license
A simple dynamic DNS client written in PHP for use with the netcup DNS API.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to dynamic-dns-netcup-api

DnsTube
Access your computer from anywhere. DnsTube is a Windows .NET dynamic DNS client for Cloudflare.
Stars: ✭ 137 (+7.87%)
Mutual labels:  ddns, dynamic-dns, ddns-client
docker-ddns-cloudflare
Cloudflare DDNS Script
Stars: ✭ 21 (-83.46%)
Mutual labels:  ddns, dynamic-dns
python-dyndnsc
dynamic dns (dyndns) update client with support for multiple protocols
Stars: ✭ 36 (-71.65%)
Mutual labels:  dynamic-dns, ddns-client
PyDDNS
Complete system to create your own server ddns
Stars: ✭ 57 (-55.12%)
Mutual labels:  ddns, ddns-client
Vultr-Dynamic-DNS
Dynamically update IP addresses in Vultr DNS without services like No-IP
Stars: ✭ 18 (-85.83%)
Mutual labels:  ddns, dynamic-dns
DynamicDNS
基于DNSPod构建的DDNS软件
Stars: ✭ 21 (-83.46%)
Mutual labels:  dynamic-dns, ddns-client
AliDDNSNet
使用 C# + .NET Core 开发的开源 DDNS 工具,基于阿里云的 DNS API 接口。
Stars: ✭ 88 (-30.71%)
Mutual labels:  ddns, ddns-client
route53-dynamic-dns
Update AWS Route53 hosted zone with current public IP address. Alternative to Dynamic DNS services such as Dyn, No-IP, etc
Stars: ✭ 29 (-77.17%)
Mutual labels:  ddns, dynamic-dns
cloudflareddns
DDNS with Cloudflare
Stars: ✭ 33 (-74.02%)
Mutual labels:  ddns
jext-cli
This is a Joomla Component Builder CLI tool for creating a Joomla! 4 component using the terminal.
Stars: ✭ 28 (-77.95%)
Mutual labels:  php-cli
Dnspython
a powerful DNS toolkit for python
Stars: ✭ 1,838 (+1347.24%)
Mutual labels:  ddns
ddns
No description or website provided.
Stars: ✭ 26 (-79.53%)
Mutual labels:  ddns
systemd-cfddns
Bash-powered DDNS client for Cloudflare-managed domain
Stars: ✭ 29 (-77.17%)
Mutual labels:  ddns-client
Ddns
🚩 自动更新域名解析到本机IP(支持dnspod,阿里DNS,CloudFlare,华为云,DNSCOM...)
Stars: ✭ 2,582 (+1933.07%)
Mutual labels:  ddns
dynamic-cloud-dns
Dynamic DNS with Google Cloud Functions
Stars: ✭ 30 (-76.38%)
Mutual labels:  dynamic-dns
xdebug
Enables Xdebug for CLI PHP scripts on demand
Stars: ✭ 12 (-90.55%)
Mutual labels:  php-cli
Pointless
A Static Blog Generator
Stars: ✭ 18 (-85.83%)
Mutual labels:  php-cli
yamete
Yamete - Hentai downloader in PHP CLI - Easy site downloader PHP system
Stars: ✭ 63 (-50.39%)
Mutual labels:  php-cli
BitSrunLoginGo
深澜校园网登录程序 Go 语言版,适用于路由器、windows、linux 等。提供对 OpenWrt、Docker、Go Module 的支持
Stars: ✭ 112 (-11.81%)
Mutual labels:  ddns
cloudflare-ddns
A script to update your Cloudflare DNS records at a glance.
Stars: ✭ 152 (+19.69%)
Mutual labels:  ddns

Dynamic DNS client for netcup DNS API

This project is not affiliated with the company netcup GmbH. Although it is developed by an employee, it is not an official client by netcup GmbH and was developed in my free time. netcup is a registered trademark of netcup GmbH, Karlsruhe, Germany.

A simple dynamic DNS client written in PHP for use with the netcup DNS API.

Requirements

  • Be a netcup customer: https://www.netcup.de – or for international customers: https://www.netcup.eu
    • You don't have to be a domain reseller to use the necessary functions for this client – every customer with a domain may use it.
  • netcup API key and API password, which can be created within your CCP at https://www.customercontrolpanel.de
  • PHP-CLI with CURL extension
  • A domain 😉

Features

Implemented

  • All necessary API functions for DNS actions implemented (REST API)
  • Determines correct public IP address, uses fallback API for determining the IP address, in case main API does return invalid / no IP
  • IPv6 Support
  • Update everything you want in one go: Every combination of domains, subdomains, domain root, and domain wildcard is possible
  • Creation of DNS record, if it doesn't already exist
  • If configured, lowers TTL to 300 seconds for the domain on each run, if necessary
  • Hiding output (quiet option)

Missing

  • Caching the IP provided to netcup DNS, to avoid running into (currently extremely tolerant) rate limits in the DNS API
  • Probably a lot more 😁 – to be continued...

Getting started

Download

Download the latest version from the releases or clone the repository:

$ git clone https://github.com/stecklars/dynamic-dns-netcup-api.git

I'm always trying to keep the master branch stable.

Then, allow update.php to be executed by your user:

chmod u+x update.php

Configuration

Configuration is very simple:

  • Copy config.dist.php to config.php
    • cp config.dist.php config.php
  • Fill out config.php with the required values. The options are explained in there.

How to use

./update.php

You should probably run this script every few minutes, so that your IP is updated as quickly as possible. Add it to your cronjobs and run it regularly, for example every five minutes.

CLI options

Just add these Options after the command like ./update.php --quiet

option function
--quiet The script won't output notices, only errors and warnings

Example outputs

$ ./update.php
[2022/01/20 00:35:02 +0000][NOTICE] =============================================
[2022/01/20 00:35:02 +0000][NOTICE] Running dynamic DNS client for netcup 3.0
[2022/01/20 00:35:02 +0000][NOTICE] This script is not affiliated with netcup.
[2022/01/20 00:35:02 +0000][NOTICE] =============================================

[2022/01/20 00:35:02 +0000][NOTICE] Logged in successfully!
[2022/01/20 00:35:02 +0000][NOTICE] Updating DNS records for domain "myfirstdomain.com"
[2022/01/20 00:35:03 +0000][NOTICE] Successfully received Domain info.
[2022/01/20 00:35:03 +0000][NOTICE] Lowered TTL to 300 seconds successfully.
[2022/01/20 00:35:03 +0000][NOTICE] Successfully received DNS record data.
[2022/01/20 00:35:03 +0000][NOTICE] Updating DNS records for subdomain "subdomain1" of domain "myfirstdomain.com".
[2022/01/20 00:35:03 +0000][NOTICE] A record for host subdomain1 doesn't exist, creating necessary DNS record.
[2022/01/20 00:35:03 +0000][NOTICE] IPv4 address has changed. Before: newly created Record; Now: 5.6.7.8
[2022/01/20 00:35:03 +0000][NOTICE] IPv4 address updated successfully!
[2022/01/20 00:35:03 +0000][NOTICE] AAAA record for host subdomain1 doesn't exist, creating necessary DNS record.
[2022/01/20 00:35:03 +0000][NOTICE] IPv6 address has changed. Before: newly created Record; Now: 2001:db8:85a3:0:0:8a2e:370:7334
[2022/01/20 00:35:03 +0000][NOTICE] IPv6 address updated successfully!
[2022/01/20 00:35:03 +0000][NOTICE] Updating DNS records for subdomain "subdomain2" of domain "myfirstdomain.com".
[2022/01/20 00:35:03 +0000][NOTICE] A record for host subdomain2 doesn't exist, creating necessary DNS record.
[2022/01/20 00:35:03 +0000][NOTICE] IPv4 address has changed. Before: newly created Record; Now: 5.6.7.8
[2022/01/20 00:35:03 +0000][NOTICE] IPv4 address updated successfully!
[2022/01/20 00:35:03 +0000][NOTICE] AAAA record for host subdomain2 doesn't exist, creating necessary DNS record.
[2022/01/20 00:35:03 +0000][NOTICE] IPv6 address has changed. Before: newly created Record; Now: 2001:db8:85a3:0:0:8a2e:370:7334
[2022/01/20 00:35:03 +0000][NOTICE] IPv6 address updated successfully!
[2022/01/20 00:35:03 +0000][NOTICE] Updating DNS records for domain "myseconddomain.com"
[2022/01/20 00:35:03 +0000][NOTICE] Successfully received Domain info.
[2022/01/20 00:35:04 +0000][NOTICE] Successfully received DNS record data.
[2022/01/20 00:35:04 +0000][NOTICE] Updating DNS records for subdomain "@" of domain "myseconddomain.com".
[2022/01/20 00:35:04 +0000][NOTICE] A record for host @ doesn't exist, creating necessary DNS record.
[2022/01/20 00:35:04 +0000][NOTICE] IPv4 address has changed. Before: newly created Record; Now: 5.6.7.8
[2022/01/20 00:35:04 +0000][NOTICE] IPv4 address updated successfully!
[2022/01/20 00:35:04 +0000][NOTICE] AAAA record for host @ doesn't exist, creating necessary DNS record.
[2022/01/20 00:35:04 +0000][NOTICE] IPv6 address has changed. Before: newly created Record; Now: 2001:db8:85a3:0:0:8a2e:370:7334
[2022/01/20 00:35:04 +0000][NOTICE] IPv6 address updated successfully!
[2022/01/20 00:35:04 +0000][NOTICE] Updating DNS records for subdomain "*" of domain "myseconddomain.com".
[2022/01/20 00:35:04 +0000][NOTICE] A record for host * doesn't exist, creating necessary DNS record.
[2022/01/20 00:35:04 +0000][NOTICE] IPv4 address has changed. Before: newly created Record; Now: 5.6.7.8
[2022/01/20 00:35:04 +0000][NOTICE] IPv4 address updated successfully!
[2022/01/20 00:35:04 +0000][NOTICE] AAAA record for host * doesn't exist, creating necessary DNS record.
[2022/01/20 00:35:04 +0000][NOTICE] IPv6 address has changed. Before: newly created Record; Now: 2001:db8:85a3:0:0:8a2e:370:7334
[2022/01/20 00:35:04 +0000][NOTICE] IPv6 address updated successfully!
[2022/01/20 00:35:04 +0000][NOTICE] Logged out successfully!
$ ./update.php
[2022/01/20 00:39:00 +0000][NOTICE] =============================================
[2022/01/20 00:39:00 +0000][NOTICE] Running dynamic DNS client for netcup 3.0
[2022/01/20 00:39:00 +0000][NOTICE] This script is not affiliated with netcup.
[2022/01/20 00:39:00 +0000][NOTICE] =============================================

[2022/01/20 00:39:00 +0000][NOTICE] Logged in successfully!
[2022/01/20 00:39:00 +0000][NOTICE] Updating DNS records for domain "myfirstdomain.com"
[2022/01/20 00:39:00 +0000][NOTICE] Successfully received Domain info.
[2022/01/20 00:39:00 +0000][NOTICE] Successfully received DNS record data.
[2022/01/20 00:39:00 +0000][NOTICE] Updating DNS records for subdomain "subdomain1" of domain "myfirstdomain.com".
[2022/01/20 00:39:00 +0000][NOTICE] IPv4 address hasn't changed. Current IPv4 address: 5.6.7.8
[2022/01/20 00:39:00 +0000][NOTICE] IPv6 address hasn't changed. Current IPv6 address: 2001:db8:85a3:0:0:8a2e:370:7334
[2022/01/20 00:39:00 +0000][NOTICE] Updating DNS records for subdomain "subdomain2" of domain "myfirstdomain.com".
[2022/01/20 00:39:00 +0000][NOTICE] IPv4 address hasn't changed. Current IPv4 address: 5.6.7.8
[2022/01/20 00:39:00 +0000][NOTICE] IPv6 address hasn't changed. Current IPv6 address: 2001:db8:85a3:0:0:8a2e:370:7334
[2022/01/20 00:39:00 +0000][NOTICE] Updating DNS records for domain "myseconddomain.com"
[2022/01/20 00:39:01 +0000][NOTICE] Successfully received Domain info.
[2022/01/20 00:39:01 +0000][NOTICE] Successfully received DNS record data.
[2022/01/20 00:39:01 +0000][NOTICE] Updating DNS records for subdomain "@" of domain "myseconddomain.com".
[2022/01/20 00:39:01 +0000][NOTICE] IPv4 address hasn't changed. Current IPv4 address: 5.6.7.8
[2022/01/20 00:39:01 +0000][NOTICE] IPv6 address hasn't changed. Current IPv6 address: 2001:db8:85a3:0:0:8a2e:370:7334
[2022/01/20 00:39:01 +0000][NOTICE] Updating DNS records for subdomain "*" of domain "myseconddomain.com".
[2022/01/20 00:39:01 +0000][NOTICE] IPv4 address hasn't changed. Current IPv4 address: 5.6.7.8
[2022/01/20 00:39:01 +0000][NOTICE] IPv6 address hasn't changed. Current IPv6 address: 2001:db8:85a3:0:0:8a2e:370:7334
[2022/01/20 00:39:01 +0000][NOTICE] Logged out successfully!
$ ./update.php
[2022/01/20 00:40:10 +0000][NOTICE] =============================================
[2022/01/20 00:40:10 +0000][NOTICE] Running dynamic DNS client for netcup 3.0
[2022/01/20 00:40:10 +0000][NOTICE] This script is not affiliated with netcup.
[2022/01/20 00:40:10 +0000][NOTICE] =============================================

[2022/01/20 00:40:10 +0000][NOTICE] Logged in successfully!
[2022/01/20 00:40:10 +0000][NOTICE] Updating DNS records for domain "myfirstdomain.com"
[2022/01/20 00:40:10 +0000][NOTICE] Successfully received Domain info.
[2022/01/20 00:40:10 +0000][NOTICE] Successfully received DNS record data.
[2022/01/20 00:40:10 +0000][NOTICE] Updating DNS records for subdomain "subdomain1" of domain "myfirstdomain.com".
[2022/01/20 00:40:10 +0000][NOTICE] IPv4 address has changed. Before: 5.6.7.8; Now: 1.2.3.4
[2022/01/20 00:40:11 +0000][NOTICE] IPv4 address updated successfully!
[2022/01/20 00:40:11 +0000][NOTICE] IPv6 address has changed. Before: 2001:db8:85a3:0:0:8a2e:370:7334; Now: 2001:db8:85a3:0:0:8a2e:370:5123
[2022/01/20 00:40:11 +0000][NOTICE] IPv6 address updated successfully!
[2022/01/20 00:40:11 +0000][NOTICE] Updating DNS records for subdomain "subdomain2" of domain "myfirstdomain.com".
[2022/01/20 00:40:11 +0000][NOTICE] IPv4 address has changed. Before: 5.6.7.8; Now: 1.2.3.4
[2022/01/20 00:40:11 +0000][NOTICE] IPv4 address updated successfully!
[2022/01/20 00:40:11 +0000][NOTICE] IPv6 address has changed. Before: 2001:db8:85a3:0:0:8a2e:370:7334; Now: 2001:db8:85a3:0:0:8a2e:370:5123
[2022/01/20 00:40:11 +0000][NOTICE] IPv6 address updated successfully!
[2022/01/20 00:40:11 +0000][NOTICE] Updating DNS records for domain "myseconddomain.com"
[2022/01/20 00:40:11 +0000][NOTICE] Successfully received Domain info.
[2022/01/20 00:40:11 +0000][NOTICE] Successfully received DNS record data.
[2022/01/20 00:40:11 +0000][NOTICE] Updating DNS records for subdomain "@" of domain "myseconddomain.com".
[2022/01/20 00:40:11 +0000][NOTICE] IPv4 address has changed. Before: 5.6.7.8; Now: 1.2.3.4
[2022/01/20 00:40:12 +0000][NOTICE] IPv4 address updated successfully!
[2022/01/20 00:40:12 +0000][NOTICE] IPv6 address has changed. Before: 2001:db8:85a3:0:0:8a2e:370:7334; Now: 2001:db8:85a3:0:0:8a2e:370:5123
[2022/01/20 00:40:12 +0000][NOTICE] IPv6 address updated successfully!
[2022/01/20 00:40:12 +0000][NOTICE] Updating DNS records for subdomain "*" of domain "myseconddomain.com".
[2022/01/20 00:40:12 +0000][NOTICE] IPv4 address has changed. Before: 5.6.7.8; Now: 1.2.3.4
[2022/01/20 00:40:12 +0000][NOTICE] IPv4 address updated successfully!
[2022/01/20 00:40:12 +0000][NOTICE] IPv6 address has changed. Before: 2001:db8:85a3:0:0:8a2e:370:7334; Now: 2001:db8:85a3:0:0:8a2e:370:5123
[2022/01/20 00:40:12 +0000][NOTICE] IPv6 address updated successfully!
[2022/01/20 00:40:12 +0000][NOTICE] Logged out successfully!

If you have ideas on how to improve this script, please don't hesitate to create an issue or provide me with a pull request. Thank you!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].