https://github.com/igorcferreira/ddnsupdater
Swift code able to update the IP for a hostname hosted using a Dynamic DNS service
https://github.com/igorcferreira/ddnsupdater
apple ddns ddns-updater ios macos noip swift swift-package-manager
Last synced: 2 months ago
JSON representation
Swift code able to update the IP for a hostname hosted using a Dynamic DNS service
- Host: GitHub
- URL: https://github.com/igorcferreira/ddnsupdater
- Owner: igorcferreira
- License: mit
- Created: 2023-03-22T16:12:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-22T17:24:15.000Z (about 2 years ago)
- Last Synced: 2024-05-02T01:24:49.518Z (about 1 year ago)
- Topics: apple, ddns, ddns-updater, ios, macos, noip, swift, swift-package-manager
- Language: Swift
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DDNSUpdater
Package with a Swift code able to update the IP for a hostname hosted using a Dynamic DNS service, like [No-ip](https://www.noip.com/) or similar.
The updater returns a String with the content returned by the DDNS service. For example: `nochg 192.0.0.1` (where "nochg" means "no change" in this context) or `good 192.168.0.1`.
The [updateddns](Sources/updateddns/updateddns.swift) command line tool can be used as an example of how to integrate with the DDNSUpdater code.
### Library Usage
```swift
import DDNSUpdaterlet authentication = BaseAuthentication(username: "account_username", password: "Account Password")
let updater = DDNSUpdater(authentcation: authentication, serviceHostname: "dynupdate.no-ip.com")
try await updater.perform(request: IPUpdateRequest(hostname: "myserver.com"))
```### Terminal command usage
```sh
# From source-code
$ swift run updateddns --username 'account_username' --password 'Account Password' --hostname 'myserver.com' --ddnsServer 'dynupdate.no-ip.com'# From built binary
$ updateddns --username 'account_username' --password 'Account Password' --hostname 'myserver.com' --ddns-server 'dynupdate.no-ip.com'
```### License
[MIT](LICENSE)