Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

[Bug] DNS posting failure #29

Open
KicinskiJodlowski opened this issue Oct 2, 2023 · 8 comments
Open

[Bug] DNS posting failure #29

KicinskiJodlowski opened this issue Oct 2, 2023 · 8 comments
Labels

Comments

@KicinskiJodlowski
Copy link

KicinskiJodlowski commented Oct 2, 2023

Error in synology "can't assign IP x.x.x.x to host address [unknown error]"

I have NAS added to section tunels in zero trust with https://localhost as target.
When I'm trying to put credentials to DDNS window in my DSM "can't connect to server, check connection status" in status of connection.
I tried to generate token with and without additional Zones>Zones-Read.

when I tried curl from SSH:

curl -s -X POST "https://api.cloudflare.com/client/v4/zones/[ZONEID]/dns_records" -H "Authorization: Bearer {TOKEN]" -H "Content-Type:application/json" --data "{"type":"A","name":"[AA.DOMAIN.COM]","content":"[IPADDRESS]","proxied":true}"
i receive response:

{"result":null,"success":false,"errors":[{"code":81054,"message":"A CNAME record with that host already exists. For more details, refer to \u003chttps://developers.cloudflare.com/dns/manage-dns-records/troubleshooting/records-with-same-name/\u003e."}],"messages":[]}

I deleted DNS and then record was made. With A type instead of CNAME but still it's not working properly.

DSM version 5.2.

@joshuaavalon
Copy link
Owner

I deleted DNS and then record was made. With A type instead of CNAME but still it's not working properly.

What is the new error then?

{"result":null,"success":false,"errors":[{"code":81054,"message":"A CNAME record with that host already exists. For more details, refer to \u003chttps://developers.cloudflare.com/dns/manage-dns-records/troubleshooting/records-with-same-name/\u003e."}],"messages":[]}

Do you know what is the difference between A and CNAME record? If CNANE record already works for you, there is no need to use a A record.

@KicinskiJodlowski
Copy link
Author

I read about the difference between CNAME and A yesterday. I may be wrong because I'm not a networking person. None of them works, CNAME was generated probably during creation of tunnel. A record was created manually from ssh based on .sh script (I replaced all &variables manually). Connection from DSM doesn't create any record even if there is none existing one on cloud flare.

@joshuaavalon
Copy link
Owner

Then, what is the error message you recevied?

@KicinskiJodlowski
Copy link
Author

I switched to pc with English. "Failed to register IP address z.z.z.z to hostname z.zzz.zz Unknown error"

And status "Failed to connect to the server. Please check the network connection of the server".

I'm reading this errors connecting via quickconnect.
Adres is z.z.z.z:63810/webman/index.cgi so I assume network connection is ok.

@joshuaavalon
Copy link
Owner

Can you try to run the following SSH in your Synology?

curl -s -X POST "https://api.cloudflare.com/client/v4/zones/${username}/dns_records" -H "Authorization: Bearer $password" -H "Content-Type:application/json" --data "{\"type\":\"A\",\"name\":\"$hostname\",\"content\":\"$ipAddr\",\"proxied\":true}"

Please replace ${username} with your <Zone ID> , $password with <API Token>, $hostname with z.zzz.zz, $ipAddr with z.z.z.z.

@KicinskiJodlowski
Copy link
Author

KicinskiJodlowski commented Oct 4, 2023

I already tried this. This curl create normal A entry on cloudflare and give standard result response. But even with that entry in browser I receive timeout 522 "host error" (browser and cloudflare have ok status). I assume that is network problem regardless the fact that raspberry I have connected in my network have working tunel in cloudflare (on CNAME entry).

{"result":{"id":"2c85072129e8cc7c984379ca408f3722","zone_id":"myZoneID","myZoneName":"zzz.zz","name":"z.zzz.zz","type":"A","content":"z.z.z.z","proxiable":true,"proxied":true,"ttl":1,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false,"source":"primary"},"comment":null,"tags":[],"created_on":"2023-10-04T10:20:55.488635Z","modified_on":"2023-10-04T10:20:55.488635Z"},"success":true,"errors":[],"messages":[]}

But when I i use GUI client in DSM entry in DNS isn't created at all (doesn't matter if there are any existing entry or all deleted).
With this settings i receive error: "Failed to register IP address z.z.z.z to hostname z.zzz.zz [Unknown error]"

Is this "E.*" in CAT command should be in config file? When I copy-paste it cat command doesn't exit so i replace it with EOF. Erlier there was line in file E*. but this wasn't working so i deleted it.

[Oray.com]
        modulepath=DynDNS
        queryurl=ddns.oray.com/ph/update?hostname=__HOSTNAME__&myip=__MYIP__
[Synology]
        modulepath=Synology
        queryurl=ddns.synology.com
        register_module=synology
        website=https://account.synology.com
[Cloudflare]
        modulepath=/sbin/cloudflareddns.sh
        queryurl=https://www.cloudflare.com
        website=https://www.cloudflare.com
[CloudflareModified]
        modulepath=/sbin/cloudflareddns.sh
        queryurl=https://www.cloudflare.com
        website=https://www.cloudflare.com

@joshuaavalon
Copy link
Owner

I already tried this. This curl create normal A entry on cloudflare and give standard result response. But even with that entry in browser I receive timeout 522 "host error" (browser and cloudflare have ok status). I assume that is network problem regardless the fact that raspberry I have connected in my network have working tunel in cloudflare (on CNAME entry).

Ok. That means the script is working if it can create an entry. Can you confirm the IP address on Cloudflare page is your actually address?

@KicinskiJodlowski
Copy link
Author

Script isn't executed or is executed with wrong params but I do not know how to debug that. Only thing I came out was copy command from sh script and replace variables with data.

Entry on cloudflare is created when I'm using curl command in ssh. When I use menu in DSM nothing happens on cloudflare side.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants