diff --git a/README.md b/README.md index 810aa34..c4f1250 100755 --- a/README.md +++ b/README.md @@ -16,12 +16,13 @@ Access your home network remotely via a custom domain name without a static IP! - πŸ”’ Zero-log IP provider ([cdn-cgi/trace](https://www.cloudflare.com/cdn-cgi/trace)) - πŸ‘ GPL-3.0 License. Open source for open audits. -## πŸ’― Complete Support of Domain Names, Subdomains, and IPv4 & IPv6 +## πŸ’― Complete Support of Domain Names, Subdomains, IPv4 & IPv6, and Load Balancing - 🌐 Supports multiple domains (zones) on the same IP. - πŸ“  Supports multiple subdomains on the same IP. - πŸ“‘ IPv4 and IPv6 support. - 🌍 Supports all Cloudflare regions. +- βš–οΈ Supports [Cloudflare Load Balancing](https://developers.cloudflare.com/load-balancing/understand-basics/pools/). - πŸ‡ΊπŸ‡Έ Made in the U.S.A. ## πŸ“Š Stats @@ -185,6 +186,83 @@ If you are using API Tokens, make sure the token used supports editing your zone } ``` +## βš–οΈ Load Balancing + +If you have multiple IP addresses and want to load balance between them, you can use the `loadBalancing` option. This will create a CNAME record for each subdomain that points to the subdomain with the lowest IP address. + +### πŸ“œ Example config to support load balancing + +```json +{ + "cloudflare": [ + { + "authentication": { + "api_token": "api_token_here", + "api_key": { + "api_key": "api_key_here", + "account_email": "your_email_here" + } + }, + "zone_id": "your_zone_id_here", + "subdomains": [ + { + "name": "", + "proxied": false + }, + { + "name": "remove_or_replace_with_your_subdomain", + "proxied": false + } + ] + } + ],{ + "cloudflare": [ + { + "authentication": { + "api_token": "api_token_here", + "api_key": { + "api_key": "api_key_here", + "account_email": "your_email_here" + } + }, + "zone_id": "your_zone_id_here", + "subdomains": [ + { + "name": "", + "proxied": false + }, + { + "name": "remove_or_replace_with_your_subdomain", + "proxied": false + } + ] + } + ], + "load_balancer": [ + { + "authentication": { + "api_token": "api_token_here", + "api_key": { + "api_key": "api_key_here", + "account_email": "your_email_here" + } + }, + "pool_id": "your_pool_id_here", + "origin": "your_origin_name_here" + } + ], + "a": true, + "aaaa": true, + "purgeUnknownRecords": false, + "ttl": 300 +} + "a": true, + "aaaa": true, + "purgeUnknownRecords": false, + "ttl": 300 +} +``` + ### 🧹 Optional features `purgeUnknownRecords` removes stale DNS records from Cloudflare. This is useful if you have a dynamic DNS record that you no longer want to use. If you have a dynamic DNS record that you no longer want to use, you can set `purgeUnknownRecords` to `true` and the script will remove the stale DNS record from Cloudflare. diff --git a/config-example.json b/config-example.json index e2ead1f..38f1097 100755 --- a/config-example.json +++ b/config-example.json @@ -21,21 +21,8 @@ ] } ], - "load_balancer": [ - { - "authentication": { - "api_token": "api_token_here", - "api_key": { - "api_key": "api_key_here", - "account_email": "your_email_here" - } - }, - "pool_id": "your_pool_id_here", - "origin": "your_origin_name_here" - } - ], "a": true, "aaaa": true, "purgeUnknownRecords": false, "ttl": 300 -} \ No newline at end of file +}