This project is a Python script for updating DNS records on Hover. It supports optional logging, TOTP-based 2FA, and the use of mitmproxy for debugging HTTP/HTTPS requests.
- Python 3.x
requestslibrarymitmproxy(optional, for debugging)
git clone <repository_url>
cd <repository_directory>Install the required Python libraries using pip:
pip install requestsmitmproxy is used for debugging HTTP/HTTPS requests. To install mitmproxy, run:
pip install mitmproxyCreate the following configuration files:
Create a config.json file in the project directory with the following content:
{
"dnsid": "<your_dns_id>",
"username": "<your_hover_username>",
"password": "<your_hover_password>",
"discoverip": "true",
"srcdomain": "this.example.com",
"ipaddress": "192.168.1.1",
"totp_secret": "<your_totp_secret>",
"logLevel": "info",
"nakedDomain": "example.com",
"logRetentionMaxDays": "7",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}dnsid: The DNS record ID to update.username: Your Hover account username.password: Your Hover account password.discoverip: Set to"true"to auto-discover your public IP.srcdomain: The subdomain to update (e.g.,"this.example.com").ipaddress: The IP address to set (overridesdiscoveripif provided).totp_secret: Your TOTP secret for 2FA (if enabled on your Hover account).logLevel: Logging level ("info","debug", etc.).nakedDomain: The root domain (e.g.,"example.com").logRetentionMaxDays: How many days to keep log files.userAgent: The User-Agent string to use for HTTP requests.
Replace the placeholders with your actual values.
Create an empty IP file in the project directory:
type nul > IP(On Linux/macOS: touch IP)
To run the script, use the following commands:
pip install -r requirements.txtpython hover-update.py [--loglevel LEVEL] [--mitm] [--nocerts] [--getDNSID] [--getDomains] [--interval SECONDS]--loglevel LEVEL: Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Overrides config.json log level. Default is INFO.--mitm: Route HTTP/HTTPS requests throughmitmproxyfor debugging.--nocerts: Disable certificate verification for mitmproxy.--getDNSID: Get DNS IDs for all domains in the account.--getDomains: Get all domains in the account.--interval SECONDS: Run at a specified interval (in seconds). Overrides config valuerunInterval.--config PATH: Path to configuration file (default:config.json).
To run the script with a custom config file:
python hover-update.py --config myconfig.jsonTo run the script with logging enabled:
python hover-update.py --loglevel INFOTo run the script with mitmproxy enabled:
python hover-update.py --mitmTo run the script with both logging and mitmproxy enabled:
python hover-update.py --loglevel DEBUG --mitmTo get DNS IDs for all domains:
python hover-update.py --getDNSIDTo get all domains:
python hover-update.py --getDomainsTo run the script every 10 minutes:
python hover-update.py --interval 600mitmproxy is a powerful tool for debugging HTTP/HTTPS requests. Follow these steps to use mitmproxy with this script:
The script is designed to run on Windows or Linux unchanged and will look for the mitmproxy certificates in the appropriate default location for that platform.
Start mitmproxy in your terminal:
mitmproxyThis will start mitmproxy and listen on port 8080 by default.
Run the script with the --mitm flag to route HTTP/HTTPS requests through mitmproxy:
python hover-update.py --mitmIn the mitmproxy interface, you can inspect the HTTP/HTTPS requests and responses being made by the script. This is useful for debugging and understanding the interactions with the Hover API.
hover-update.py: Main script for updating DNS records on Hover.totp.py: Contains the TOTP generation function.config.json: Configuration file with user credentials and settings.IP: File to store the last known IP address (automatically generated when the IP is resolved).hover-update.log: Log file (created automatically if logging is enabled).
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
For any questions or issues, please contact pj@code-geeks.com.