|
15 | 15 | ### Implemented |
16 | 16 | * All necessary API functions for DNS actions implemented (REST API) |
17 | 17 | * Determines correct public IP address, uses fallback API for determining the IP address, in case main API does return invalid / no IP |
18 | | -* IPv6 Support |
| 18 | +* Automatically retries API requests on errors |
| 19 | +* IPv4 and IPv6 Support (can be individually enabled / disabled) |
| 20 | +* Possible to manually provide IPv4 / IPv6 address to set as a CLI option |
19 | 21 | * Update everything you want in one go: Every combination of domains, subdomains, domain root, and domain wildcard is possible |
20 | 22 | * Creation of DNS record, if it doesn't already exist |
21 | 23 | * If configured, lowers TTL to 300 seconds for the domain on each run, if necessary |
@@ -51,119 +53,13 @@ You should probably run this script every few minutes, so that your IP is update |
51 | 53 | ### CLI options |
52 | 54 | Just add these Options after the command like `./update.php --quiet` |
53 | 55 |
|
54 | | -| option | function | |
55 | | -| ------------- |----------------------------------------------------------:| |
56 | | -| --quiet | The script won't output notices, only errors and warnings | |
57 | | - |
58 | | -## Example outputs |
59 | | -``` |
60 | | -$ ./update.php |
61 | | -[2022/01/20 00:35:02 +0000][NOTICE] ============================================= |
62 | | -[2022/01/20 00:35:02 +0000][NOTICE] Running dynamic DNS client for netcup 3.0 |
63 | | -[2022/01/20 00:35:02 +0000][NOTICE] This script is not affiliated with netcup. |
64 | | -[2022/01/20 00:35:02 +0000][NOTICE] ============================================= |
65 | | -
|
66 | | -[2022/01/20 00:35:02 +0000][NOTICE] Logged in successfully! |
67 | | -[2022/01/20 00:35:02 +0000][NOTICE] Updating DNS records for domain "myfirstdomain.com" |
68 | | -[2022/01/20 00:35:03 +0000][NOTICE] Successfully received Domain info. |
69 | | -[2022/01/20 00:35:03 +0000][NOTICE] Lowered TTL to 300 seconds successfully. |
70 | | -[2022/01/20 00:35:03 +0000][NOTICE] Successfully received DNS record data. |
71 | | -[2022/01/20 00:35:03 +0000][NOTICE] Updating DNS records for subdomain "subdomain1" of domain "myfirstdomain.com". |
72 | | -[2022/01/20 00:35:03 +0000][NOTICE] A record for host subdomain1 doesn't exist, creating necessary DNS record. |
73 | | -[2022/01/20 00:35:03 +0000][NOTICE] IPv4 address has changed. Before: newly created Record; Now: 5.6.7.8 |
74 | | -[2022/01/20 00:35:03 +0000][NOTICE] IPv4 address updated successfully! |
75 | | -[2022/01/20 00:35:03 +0000][NOTICE] AAAA record for host subdomain1 doesn't exist, creating necessary DNS record. |
76 | | -[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 |
77 | | -[2022/01/20 00:35:03 +0000][NOTICE] IPv6 address updated successfully! |
78 | | -[2022/01/20 00:35:03 +0000][NOTICE] Updating DNS records for subdomain "subdomain2" of domain "myfirstdomain.com". |
79 | | -[2022/01/20 00:35:03 +0000][NOTICE] A record for host subdomain2 doesn't exist, creating necessary DNS record. |
80 | | -[2022/01/20 00:35:03 +0000][NOTICE] IPv4 address has changed. Before: newly created Record; Now: 5.6.7.8 |
81 | | -[2022/01/20 00:35:03 +0000][NOTICE] IPv4 address updated successfully! |
82 | | -[2022/01/20 00:35:03 +0000][NOTICE] AAAA record for host subdomain2 doesn't exist, creating necessary DNS record. |
83 | | -[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 |
84 | | -[2022/01/20 00:35:03 +0000][NOTICE] IPv6 address updated successfully! |
85 | | -[2022/01/20 00:35:03 +0000][NOTICE] Updating DNS records for domain "myseconddomain.com" |
86 | | -[2022/01/20 00:35:03 +0000][NOTICE] Successfully received Domain info. |
87 | | -[2022/01/20 00:35:04 +0000][NOTICE] Successfully received DNS record data. |
88 | | -[2022/01/20 00:35:04 +0000][NOTICE] Updating DNS records for subdomain "@" of domain "myseconddomain.com". |
89 | | -[2022/01/20 00:35:04 +0000][NOTICE] A record for host @ doesn't exist, creating necessary DNS record. |
90 | | -[2022/01/20 00:35:04 +0000][NOTICE] IPv4 address has changed. Before: newly created Record; Now: 5.6.7.8 |
91 | | -[2022/01/20 00:35:04 +0000][NOTICE] IPv4 address updated successfully! |
92 | | -[2022/01/20 00:35:04 +0000][NOTICE] AAAA record for host @ doesn't exist, creating necessary DNS record. |
93 | | -[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 |
94 | | -[2022/01/20 00:35:04 +0000][NOTICE] IPv6 address updated successfully! |
95 | | -[2022/01/20 00:35:04 +0000][NOTICE] Updating DNS records for subdomain "*" of domain "myseconddomain.com". |
96 | | -[2022/01/20 00:35:04 +0000][NOTICE] A record for host * doesn't exist, creating necessary DNS record. |
97 | | -[2022/01/20 00:35:04 +0000][NOTICE] IPv4 address has changed. Before: newly created Record; Now: 5.6.7.8 |
98 | | -[2022/01/20 00:35:04 +0000][NOTICE] IPv4 address updated successfully! |
99 | | -[2022/01/20 00:35:04 +0000][NOTICE] AAAA record for host * doesn't exist, creating necessary DNS record. |
100 | | -[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 |
101 | | -[2022/01/20 00:35:04 +0000][NOTICE] IPv6 address updated successfully! |
102 | | -[2022/01/20 00:35:04 +0000][NOTICE] Logged out successfully! |
103 | | -``` |
104 | | -``` |
105 | | -$ ./update.php |
106 | | -[2022/01/20 00:39:00 +0000][NOTICE] ============================================= |
107 | | -[2022/01/20 00:39:00 +0000][NOTICE] Running dynamic DNS client for netcup 3.0 |
108 | | -[2022/01/20 00:39:00 +0000][NOTICE] This script is not affiliated with netcup. |
109 | | -[2022/01/20 00:39:00 +0000][NOTICE] ============================================= |
110 | | -
|
111 | | -[2022/01/20 00:39:00 +0000][NOTICE] Logged in successfully! |
112 | | -[2022/01/20 00:39:00 +0000][NOTICE] Updating DNS records for domain "myfirstdomain.com" |
113 | | -[2022/01/20 00:39:00 +0000][NOTICE] Successfully received Domain info. |
114 | | -[2022/01/20 00:39:00 +0000][NOTICE] Successfully received DNS record data. |
115 | | -[2022/01/20 00:39:00 +0000][NOTICE] Updating DNS records for subdomain "subdomain1" of domain "myfirstdomain.com". |
116 | | -[2022/01/20 00:39:00 +0000][NOTICE] IPv4 address hasn't changed. Current IPv4 address: 5.6.7.8 |
117 | | -[2022/01/20 00:39:00 +0000][NOTICE] IPv6 address hasn't changed. Current IPv6 address: 2001:db8:85a3:0:0:8a2e:370:7334 |
118 | | -[2022/01/20 00:39:00 +0000][NOTICE] Updating DNS records for subdomain "subdomain2" of domain "myfirstdomain.com". |
119 | | -[2022/01/20 00:39:00 +0000][NOTICE] IPv4 address hasn't changed. Current IPv4 address: 5.6.7.8 |
120 | | -[2022/01/20 00:39:00 +0000][NOTICE] IPv6 address hasn't changed. Current IPv6 address: 2001:db8:85a3:0:0:8a2e:370:7334 |
121 | | -[2022/01/20 00:39:00 +0000][NOTICE] Updating DNS records for domain "myseconddomain.com" |
122 | | -[2022/01/20 00:39:01 +0000][NOTICE] Successfully received Domain info. |
123 | | -[2022/01/20 00:39:01 +0000][NOTICE] Successfully received DNS record data. |
124 | | -[2022/01/20 00:39:01 +0000][NOTICE] Updating DNS records for subdomain "@" of domain "myseconddomain.com". |
125 | | -[2022/01/20 00:39:01 +0000][NOTICE] IPv4 address hasn't changed. Current IPv4 address: 5.6.7.8 |
126 | | -[2022/01/20 00:39:01 +0000][NOTICE] IPv6 address hasn't changed. Current IPv6 address: 2001:db8:85a3:0:0:8a2e:370:7334 |
127 | | -[2022/01/20 00:39:01 +0000][NOTICE] Updating DNS records for subdomain "*" of domain "myseconddomain.com". |
128 | | -[2022/01/20 00:39:01 +0000][NOTICE] IPv4 address hasn't changed. Current IPv4 address: 5.6.7.8 |
129 | | -[2022/01/20 00:39:01 +0000][NOTICE] IPv6 address hasn't changed. Current IPv6 address: 2001:db8:85a3:0:0:8a2e:370:7334 |
130 | | -[2022/01/20 00:39:01 +0000][NOTICE] Logged out successfully! |
131 | | -``` |
132 | | -``` |
133 | | -$ ./update.php |
134 | | -[2022/01/20 00:40:10 +0000][NOTICE] ============================================= |
135 | | -[2022/01/20 00:40:10 +0000][NOTICE] Running dynamic DNS client for netcup 3.0 |
136 | | -[2022/01/20 00:40:10 +0000][NOTICE] This script is not affiliated with netcup. |
137 | | -[2022/01/20 00:40:10 +0000][NOTICE] ============================================= |
138 | | -
|
139 | | -[2022/01/20 00:40:10 +0000][NOTICE] Logged in successfully! |
140 | | -[2022/01/20 00:40:10 +0000][NOTICE] Updating DNS records for domain "myfirstdomain.com" |
141 | | -[2022/01/20 00:40:10 +0000][NOTICE] Successfully received Domain info. |
142 | | -[2022/01/20 00:40:10 +0000][NOTICE] Successfully received DNS record data. |
143 | | -[2022/01/20 00:40:10 +0000][NOTICE] Updating DNS records for subdomain "subdomain1" of domain "myfirstdomain.com". |
144 | | -[2022/01/20 00:40:10 +0000][NOTICE] IPv4 address has changed. Before: 5.6.7.8; Now: 1.2.3.4 |
145 | | -[2022/01/20 00:40:11 +0000][NOTICE] IPv4 address updated successfully! |
146 | | -[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 |
147 | | -[2022/01/20 00:40:11 +0000][NOTICE] IPv6 address updated successfully! |
148 | | -[2022/01/20 00:40:11 +0000][NOTICE] Updating DNS records for subdomain "subdomain2" of domain "myfirstdomain.com". |
149 | | -[2022/01/20 00:40:11 +0000][NOTICE] IPv4 address has changed. Before: 5.6.7.8; Now: 1.2.3.4 |
150 | | -[2022/01/20 00:40:11 +0000][NOTICE] IPv4 address updated successfully! |
151 | | -[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 |
152 | | -[2022/01/20 00:40:11 +0000][NOTICE] IPv6 address updated successfully! |
153 | | -[2022/01/20 00:40:11 +0000][NOTICE] Updating DNS records for domain "myseconddomain.com" |
154 | | -[2022/01/20 00:40:11 +0000][NOTICE] Successfully received Domain info. |
155 | | -[2022/01/20 00:40:11 +0000][NOTICE] Successfully received DNS record data. |
156 | | -[2022/01/20 00:40:11 +0000][NOTICE] Updating DNS records for subdomain "@" of domain "myseconddomain.com". |
157 | | -[2022/01/20 00:40:11 +0000][NOTICE] IPv4 address has changed. Before: 5.6.7.8; Now: 1.2.3.4 |
158 | | -[2022/01/20 00:40:12 +0000][NOTICE] IPv4 address updated successfully! |
159 | | -[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 |
160 | | -[2022/01/20 00:40:12 +0000][NOTICE] IPv6 address updated successfully! |
161 | | -[2022/01/20 00:40:12 +0000][NOTICE] Updating DNS records for subdomain "*" of domain "myseconddomain.com". |
162 | | -[2022/01/20 00:40:12 +0000][NOTICE] IPv4 address has changed. Before: 5.6.7.8; Now: 1.2.3.4 |
163 | | -[2022/01/20 00:40:12 +0000][NOTICE] IPv4 address updated successfully! |
164 | | -[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 |
165 | | -[2022/01/20 00:40:12 +0000][NOTICE] IPv6 address updated successfully! |
166 | | -[2022/01/20 00:40:12 +0000][NOTICE] Logged out successfully! |
167 | | -``` |
| 56 | +| short option | long option | function | |
| 57 | +| ------------ | ------------------ |----------------------------------------------------------:| |
| 58 | +| -q | --quiet | The script won't output notices, only errors and warnings | |
| 59 | +| -c | --config | Manually provide a path to the config file | |
| 60 | +| -4 | --ipv4 | Manually provide the IPv4 address to set | |
| 61 | +| -6 | --ipv6 | Manually provide the IPv6 address to set | |
| 62 | +| -h | --help | Outputs this help | |
| 63 | +| -v | --version | Outputs the current version of the script | |
168 | 64 |
|
169 | 65 | 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! |
0 commit comments