This is a Java DNS updater for No-IP, an alternative to DUC (DNS Update Client). This updater is using both Ipify and No-IP APIs to retrieve your current IP address and update your No-IP hostname. See: settings.json
| Property | Description |
|---|---|
| userName | your No-IP username |
| password | your No-IP password |
| hostName | the hostname(s) (host.domain.com) or group(s) (group_name) to be updated |
| userAgent | HTTP User-Agent to help No-IP identify your client |
| ipProtocol | IP protocol to use: ipv4, ipv6, or dual (default) |
Note: when making an update it's important to configure through the userAgent property an HTTP User-Agent in order to help No-IP identify different clients that access the system. Clients that don't supply a User-Agent risk being blocked from the system. Your user agent should be in the following format:
NameOfUpdateProgram/VersionNumber maintainercontact@domain.com
The ipProtocol setting allows you to choose which IP address type to use when updating your No-IP hostname:
| Value | Ipify API Endpoint | Description |
|---|---|---|
ipv4 |
api.ipify.org | IPv4 only |
ipv6 |
api6.ipify.org | IPv6 only |
dual (default) |
api64.ipify.org | Returns either IPv4 or IPv6 based on your network |
Example settings.json:
{
"userName": "your_username",
"password": "your_password",
"hostName": "yourhost.ddns.net",
"userAgent": "MyApp/1.0 your@email.com",
"ipProtocol": "dual"
}You can also override this setting using the environment variable NOIP_IP_PROTOCOL:
export NOIP_IP_PROTOCOL=ipv6Default: dual (automatically detects IPv4/IPv6)
One-liner to download, configure and execute:
Windows (PowerShell):
powershell -ExecutionPolicy Bypass -Command "Invoke-RestMethod -Uri 'https://raw.githubusercontent.com/davidecolombo/noip/master/Install.ps1' | Invoke-Expression"Or download and run locally:
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/davidecolombo/noip/master/Install.ps1' -OutFile Install.ps1
.\Install.ps1For enhanced security, you can encrypt your password in the settings file instead of storing it as plaintext. The application uses AES-256 encryption with a master key that you provide at runtime.
Option 1: Using the CLI
java -jar noip.jar -encrypt "your_plaintext_password" -encryptor-key "your_master_key"Option 2: Using the script (Windows)
.\Encrypt.ps1 -Password "your_plaintext_password" -Key "your_master_key"This will output something like:
ENC(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
Update your settings.json to use the encrypted password:
{
"userName": "your_username",
"password": "ENC(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...)",
"hostName": "yourhost.ddns.net",
"userAgent": "MyApp/1.0 your@email.com"
}Provide the master key at runtime using one of these methods (priority order):
1. CLI argument (highest priority)
java -jar noip.jar -settings settings.json -encryptor-key "your_master_key"2. Environment variable
export NOIP_ENCRYPTOR_KEY="your_master_key"
java -jar noip.jar -settings settings.json3. System property (lowest priority)
java -Dnoip.encryptor.key="your_master_key" -jar noip.jar -settings settings.json- Encrypt:
-encrypt <password>- Encrypt a plaintext password - Decrypt:
-decrypt <encrypted_value>- Decrypt an encrypted value to verify - Encryptor Key:
-encryptor-key <key>- Specify the encryption key (highest priority)
- The master key is never stored in the configuration file
- If the password does not start with
ENC(, it is treated as plaintext (backward compatible) - Keep your master key safe - without it, the encrypted password cannot be decrypted
- On Unix systems, consider using a
.envfile loaded by your cron job to set the environment variable
You can override settings from the JSON file using environment variables. Environment variables take precedence over file settings.
| Variable | Description | Default |
|---|---|---|
NOIP_USERNAME |
Override username | - |
NOIP_PASSWORD |
Override password (plaintext) | - |
NOIP_USER_AGENT |
Override user-agent | NoIP-Java/1.0 no-reply@noip.local |
NOIP_HOSTNAME |
Override hostname | - |
NOIP_IP_PROTOCOL |
Override IP protocol (ipv4, ipv6, dual) |
dual |
NOIP_ENCRYPTOR_KEY |
Encryption key for encrypted passwords | - |
export NOIP_USERNAME="myuser"
export NOIP_PASSWORD="mypass"
export NOIP_USER_AGENT="MyApp/1.0 my@email.com"
export NOIP_HOSTNAME="myhost.ddns.net"
export NOIP_IP_PROTOCOL="ipv6"
java -jar noip.jar -settings settings.jsonFor each setting, the priority is:
- Environment variable (highest)
- Encrypted password in file (for password only)
- Plaintext value in file (lowest)
For ipProtocol, the priority is:
- Environment variable (
NOIP_IP_PROTOCOL) - Value in settings file (
dualby default)
The encryption key is resolved in this order:
- CLI argument (
-encryptor-key) - Environment variable (
NOIP_ENCRYPTOR_KEY) - System property (
noip.encryptor.key)
Please note you may want to schedule the application execution in order to keep updated your dynamic DNS, and the simplest way on *NIX systems is probably using Cron. Example:
*/30 * * * * sudo NOIP_ENCRYPTOR_KEY="your_master_key" java -cp /home/user/noip.jar io.github.davidecolombo.noip.App -settings /home/user/settings.json > /home/user/noip-log.txt 2>&1
Successful execution (IP unchanged - "nochg"):
Running No-IP updater with:
Username: <username>
Hostname: <hostname>
SLF4J(I): Connected with provider of type [ch.qos.logback.classic.spi.LogbackServiceProvider]
[main] INFO u.o.l.s.context.SysOutOverSLF4J - Replaced standard System.out and System.err PrintStreams with SLF4JPrintStreams
[main] INFO u.o.l.s.context.SysOutOverSLF4J - Redirected System.out and System.err to SLF4J for this context
[main] INFO io.github.davidecolombo.noip.App - Starting No-IP update process with settings file: src\test\resources\settings.json
[main] INFO i.g.d.noip.NoIpUpdater - No-IP configuration loaded and validated successfully
[main] INFO i.g.d.noip.NoIpUpdater - Retrieving current IP address from Ipify API
[main] INFO i.g.d.noip.NoIpUpdater - Retrieved IP address '<ip_address>' from Ipify in <time>ms
[main] INFO i.g.d.noip.NoIpUpdater - Updating No-IP hostname '<hostname>' to IP address '<ip_address>'
[main] INFO i.g.d.noip.NoIpUpdater - No-IP API request completed in <time>ms - HTTP status: 200 OK
[main] INFO i.g.d.noip.NoIpUpdater - No-IP response for hostname '<hostname>': nochg <ip_address>
[main] WARN io.github.davidecolombo.noip.App - No-IP update completed with status code: 1
[main] INFO io.github.davidecolombo.noip.App - Application exiting with status code: 1
| Code | Description |
|---|---|
| 0 | Success - IP address was updated |
| 1 | Success - IP address is already up to date (nochg) |
| 2 | Error - Invalid hostname |
| 3 | Error - Authentication failed (badauth) |
| -1 | Error - Unexpected error |
Or using a wrapper script that sets the environment variable: