Skip to content

https://1.1.1.1/cdn-cgi/trace is down and script tries to update the records with HTML code of the error page #202

Open
@a-reda

Description

Describe the bug
Main script fails to determine current IP address as https://1.1.1.1/cdn-cgi/trace is down and therefore fails to update Cloudflare's records

Probably adding a check that and IPv4 Ip has been returned is worth it before trying to update Cloudlfare's records (instead of using HTML response)

To Reproduce
Logs showing the failed IP request and tries to update Cloudflare's records with HTML code of the error page

🧩 IPv4 not detected via 1.1.1.1, trying 1.0.0.1
🧩 IPv4 not detected via 1.0.0.1. Verify your ISP or DNS provider isn't blocking Cloudflare's IPs.
🗑️  Deleted stale record record-id
➕ Adding new record {'type': 'A', 'name': 'NAME 'content': ['<!DOCTYPE html>', '<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->', '<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->', '<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->', '<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->', 
...
😡 Error sending 'POST' request to 'https://api.cloudflare.com/client/v4/zones/recors-id/dns_records':
{"result":null,"success":false,"errors":[{"code":9207,"message":"Request body is invalid."}],"messages":[]}

Currently using the following work around to determine the adress

 a = requests.get("https://ifconfig.co/json").json()['ip']

Expected behavior
Should determine IP address correctly and update records accordingly

Screenshots
Current error in https://1.1.1.1/cdn-cgi/trace
cld

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions