ddns-updater icon indicating copy to clipboard operation
ddns-updater copied to clipboard

Bug: Porkbun old records not overridden

Open yefenghu opened this issue 3 years ago • 20 comments

DNS resolution records can be updated, but the old ones will not be overwritten, and new ones will always be added. Make it unable to take effect image image this is my config.json

"settings": [
{
"provider": "porkbun",
"domain": "domian",
"host": "@",
"api_key": "***",
"secret_api_key": "***",
"ip_version": "ipv4"
},
{
"provider": "porkbun",
"domain": "domian",
"host": "*",
"api_key": "***",
"secret_api_key": "***",
"ip_version": "ipv4"
}
]
}

yefenghu avatar Sep 28 '21 06:09 yefenghu

Indeed, I think the implementation was not actually tested by anyone 😄 It should be fixed now, please pull the latest image (once this build is done in 5 minutes) and try again. Thanks!

qdm12 avatar Sep 28 '21 14:09 qdm12

thank you for fix it .the first-level domain can be replaced normally, but the pan-domain name will still be added, such as *.yefenghu.xxx have Duplicate DNS resolution

yefenghu avatar Sep 29 '21 01:09 yefenghu

So the bug is still occurring right? I'll check again tomorrow.

qdm12 avatar Sep 29 '21 02:09 qdm12

yes,The top-level domain is correct, there are still problems with subdomains

yefenghu avatar Sep 29 '21 02:09 yefenghu

Try with:

docker run -it --rm alpine:3.14
apk add curl
curl -X POST -d '{"secretapikey": "YOURSECRETAPIKEY", "apikey": "YOURAPIKEY"}' https://porkbun.com/api/json/v3/dns/retrieveByNameType/YOURDOMAIN/A/YOURSUBDOMAIN
exit

(Replacing YOUR* values with your own)

What results do you get? You should get at least one record:

{"records": [{"id": "some id", "otherfields": "..."}]}

qdm12 avatar Oct 02 '21 17:10 qdm12

Just a small reminder 😉 Thanks!!

qdm12 avatar Oct 14 '21 20:10 qdm12

You are the most aggressive maintenance developer I've ever seen, although the pan-domain still has duplicate resolution issues

yefenghu avatar Oct 15 '21 00:10 yefenghu

Haha I'll take that as a compliment 😄 You know, just tryin' to burn some issues!

And I would need you to run that curl command in the comment above (here) please. It can wait a few days, no pressure 😉

qdm12 avatar Oct 15 '21 03:10 qdm12

Sorry, I forgot about it. the link https://porkbun.com/api/json/v3/dns/retrieveByNameType/YOURDOMAIN/A/YOURSUBDOMAIN Can the YOURSUBDOMAIN in exit be in the form of *.domain.com?

yefenghu avatar Oct 15 '21 03:10 yefenghu

Maybe, Try replacing YOURSUBDOMAIN with *, the URL would look like https://porkbun.com/api/json/v3/dns/retrieveByNameType/example.com/A/*

qdm12 avatar Oct 15 '21 14:10 qdm12

this is command:

curl -X POST -d '{"secretapikey": "sk1_***", "apikey": "pk1_***"}' https://porkbun.com/api/json/v3/dns/retrieveByNameType/mydomain/A/*

the results is :

<!DOCTYPE html>
<html lang="en">
<head>
<title>Error</title>
<style type="text/css">

::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }

body {
        background-color: #fff;
        margin: 40px;
        font: 13px/20px normal Helvetica, Arial, sans-serif;
        color: #4F5155;
}

a {
        color: #003399;
        background-color: transparent;
        font-weight: normal;
}

h1 {
        color: #444;
        background-color: transparent;
        border-bottom: 1px solid #D0D0D0;
        font-size: 19px;
        font-weight: normal;
        margin: 0 0 14px 0;
        padding: 14px 15px 10px 15px;
}

code {
        font-family: Consolas, Monaco, Courier New, Courier, monospace;
        font-size: 12px;
        background-color: #f9f9f9;
        border: 1px solid #D0D0D0;
        color: #002166;
        display: block;
        margin: 14px 0 14px 0;
        padding: 12px 10px 12px 10px;
}

#container {
        margin: 10px;
        border: 1px solid #D0D0D0;
        -webkit-box-shadow: 0 0 8px #D0D0D0;
}

p {
        margin: 12px 15px 12px 15px;
}

</style>
</head>


<body>
        <div id="container">
                <h1>An Error Was Encountered</h1>
                <p>The URI you submitted has disallowed characters.</p>         <p>You can probably find what you're looking for on our <a href="/">homepage</a>.</p>
        </div>
</body>
</html>

yefenghu avatar Oct 17 '21 08:10 yefenghu

🤔 I guess you can't specify * in the URL. That might be a bug on their API, since you can't retrieve the wildcard record.

I'll modify the code to retrieve all records for the domain so that we could have the wildcard host too. Maybe try:

curl -X POST -d '{"secretapikey": "sk1_***", "apikey": "pk1_***"}' https://porkbun.com/api/json/v3/dns/retrieveByNameType/mydomain/A/

Do you get all the records including the wildcard one?

Also is the problem now only about wildcard records or all subdomains? Thanks!!

qdm12 avatar Oct 18 '21 00:10 qdm12

i have try wildcard and domain,subdomains i never setting.need to try subdomains?

yefenghu avatar Oct 18 '21 01:10 yefenghu

there are still problems with subdomains

You said subdomains, so is it just a problem with wildcards or with all subdomains?

Also please try that curl command mentioned https://github.com/qdm12/ddns-updater/issues/247#issuecomment-945237981 see how your wildcard record is in the response so I can fix the wildcard.

qdm12 avatar Oct 18 '21 12:10 qdm12

https://github.com/qdm12/ddns-updater/issues/247#issuecomment-945072283 thisi my wildcard record response .i have not use curl command test subdomains.

yefenghu avatar Oct 18 '21 12:10 yefenghu

#247 (comment) thisi my wildcard record response .i have not use curl command test subdomains.

Yes but try the same command by removing the suffix * at the end of the url (see comment above https://github.com/qdm12/ddns-updater/issues/247#issuecomment-945237981)

qdm12 avatar Oct 19 '21 12:10 qdm12

root@OpenWrt:~# docker run -it --rm alpine:3.14
Unable to find image 'alpine:3.14' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:42435->[::1]:53: read: connection refused.

yefenghu avatar Oct 20 '21 02:10 yefenghu

i try the same command by removing the suffix * at the end .

{"status":"SUCCESS","cloudflare":"disabled","records":[{"id":"168081851","name":"mydomain","type":"A","content":"IP","ttl":"600","prio":"0"}]}

yefenghu avatar Oct 20 '21 14:10 yefenghu

root@OpenWrt:~# docker run -it --rm alpine:3.14
Unable to find image 'alpine:3.14' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:42435->[::1]:53: read: connection refused.

Oh-oh that's strange, maybe your DNS is blocking docker hub?

i try the same command by removing the suffix * at the end .

{"status":"SUCCESS","cloudflare":"disabled","records":[{"id":"168081851","name":"mydomain","type":"A","content":"IP","ttl":"600","prio":"0"}]}

Ugh so they only return the record for host @ I guess. EDIT: Or do you actually see e.g. "name": "*.mydomain.com"?? ⁉️

I have no idea how to get the wildcard record then. Maybe contact their support about it? 🤔 It might be a bug since it looks like they disallow * character in the URL (The URI you submitted has disallowed characters).

If they don't want to fix it, the alternative would be to set your record id as an additional field for wildcard hosts. Actually can you find the record ID of your wildcard host from their web UI or anywhere??

qdm12 avatar Oct 21 '21 03:10 qdm12

Any update on this?

qdm12 avatar Feb 21 '22 01:02 qdm12

I guess not. For me porkbun is working, but I am not using wildcard.

In their documentation they mention only if you use "DNS Edit Record by Domain and ID" you can use wildcard. NOT with subdomain.

So this behaviour as @yefenghu mentioned is intended.

esackbauer avatar Apr 28 '23 13:04 esackbauer

Closing this due to inactivity and response from @esackbauer (thanks btw)

qdm12 avatar Jun 12 '23 06:06 qdm12