2025-03-04 14:53:24 +01:00
# DNSDrone
2025-03-06 10:51:51 +01:00
DNSDrone is a collection of scripts for automatically updating DNS records (A, AAAA, PTR, and TXT) in FreeIPA or standard DNS servers. It supports both Bash environments and Mikrotik routers.
2025-03-04 14:53:24 +01:00
## Features
2025-03-06 10:51:51 +01:00
### Common Features
- Full DNS record management (A, AAAA, PTR, and TXT records)
- IPv6 prefix tracking and updates
- Support for zone apex (root domain) updates
- FreeIPA API integration
### Bash Script Features
2025-03-04 18:27:44 +01:00
- Dual authentication support (FreeIPA user/password or TSIG keys)
- Flexible configuration with environment variables and multiple .env file locations
- Advanced operational modes (debug, dry-run, auto-update)
- Multiple IP provider fallback for reliable address detection
2025-03-06 10:51:51 +01:00
- Automatic updates with version checking
### Mikrotik Script Features
- Native RouterOS integration
- DHCP client-based IP detection
- DoH (DNS over HTTPS) support for TXT record queries
- Cookie-based FreeIPA authentication
2025-03-04 14:53:24 +01:00
## Prerequisites
2025-03-06 10:51:51 +01:00
### For Bash Script
2025-03-04 14:53:24 +01:00
- curl
- jq
- dig
- nsupdate
- [ipcalc or ipcalc-ng ](https://gitlab.com/ipcalc/ipcalc ) ("ng" for Debian-based distros)
2025-03-06 10:51:51 +01:00
### For Mikrotik Script
- RouterOS with SSH capability
- DHCP client configuration
- Internet connectivity for API access
2025-03-04 14:53:24 +01:00
## Configuration
2025-03-06 10:51:51 +01:00
### Bash Script Configuration
2025-03-04 14:53:24 +01:00
The script looks for a `.env` file in the following locations (in order):
1. Current working directory (`.env` )
2. Script's real path directory (`.env` )
3. Script's real path directory (`.env.<script_name>` )
4. Script's symlink path directory (`.env.<symlink_name>` )
5. `/opt/skyfritt-tools-env/.env.<symlink_name>`
2025-03-06 10:51:51 +01:00
#### Required Variables
2025-03-04 14:53:24 +01:00
| Variable | Description |
|----------|-------------|
| `SERVER` | DNS server hostname or IP address |
| `ZONE_NAME` | DNS zone name (e.g., "example.com") |
| `RECORD_NAME` | Hostname to update (without domain). Skip to update zone apex |
2025-03-06 10:51:51 +01:00
[Rest of the existing configuration documentation remains the same...]
### Mikrotik Script Configuration
Configure the script by modifying the CONFIG dictionary:
```rsc
:local CONFIG {
"wanInterface"="VLAN666_Altibox";
"IpaServer"="ipa.demo1.freeipa.org";
"dnsZone"="demo1.freeipa.org";
"IpaUser"="admin";
"IpaPassword"="Secret123";
"apiVersion"="2.253";
"recordTTL"="300";
# [Additional configuration options...]
}
```
2025-03-04 14:53:24 +01:00
2025-03-06 10:51:51 +01:00
## Usage
2025-03-04 14:53:24 +01:00
2025-03-06 10:51:51 +01:00
### Bash Script
```bash
# Basic usage
./dnsdrone.sh
2025-03-04 14:53:24 +01:00
2025-03-06 10:51:51 +01:00
# Debug mode
./dnsdrone.sh -d
# Dry run
./dnsdrone.sh -n
# Check for updates
./dnsdrone.sh -c
# Auto-update
./dnsdrone.sh -a
2025-03-04 18:27:44 +01:00
```
2025-03-06 10:41:55 +01:00
2025-03-06 10:51:51 +01:00
### Mikrotik Script
1. Upload the script to your Mikrotik router
2. Configure the CONFIG dictionary
3. Run manually or schedule via RouterOS scheduler
## License
2025-03-06 10:41:55 +01:00
Licensed under GNU Affero General Public License v3 (AGPL-3.0)