Bug: Porkbun old records not overridden #145

Closed
opened 2025-11-20 04:20:52 -05:00 by saavagebueno · 22 comments
Owner

Originally created by @yefenghu on GitHub (Sep 28, 2021).

Originally assigned to: @qdm12 on GitHub.

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"
}
]
}
Originally created by @yefenghu on GitHub (Sep 28, 2021). Originally assigned to: @qdm12 on GitHub. 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](https://user-images.githubusercontent.com/81460075/135031666-35eabd9a-5944-486d-b6a8-33c9991cb32d.png) ![image](https://user-images.githubusercontent.com/81460075/135031835-34f645dc-9d2b-4ea8-b8f4-18e50fdd5ca1.png) this is my config.json ```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" } ] } ```
Author
Owner

@qdm12 commented on GitHub (Sep 28, 2021):

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 commented on GitHub (Sep 28, 2021): 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](https://github.com/qdm12/ddns-updater/actions/runs/1282993338)) and try again. Thanks!
Author
Owner

@yefenghu commented on GitHub (Sep 28, 2021):

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 commented on GitHub (Sep 28, 2021): 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
Author
Owner

@qdm12 commented on GitHub (Sep 28, 2021):

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

@qdm12 commented on GitHub (Sep 28, 2021): So the bug is still occurring right? I'll check again tomorrow.
Author
Owner

@yefenghu commented on GitHub (Sep 28, 2021):

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

@yefenghu commented on GitHub (Sep 28, 2021): yes,The top-level domain is correct, there are still problems with subdomains
Author
Owner

@qdm12 commented on GitHub (Oct 2, 2021):

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 commented on GitHub (Oct 2, 2021): Try with: ```sh 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: ```json {"records": [{"id": "some id", "otherfields": "..."}]} ```
Author
Owner

@qdm12 commented on GitHub (Oct 14, 2021):

Just a small reminder 😉 Thanks!!

@qdm12 commented on GitHub (Oct 14, 2021): Just a small reminder 😉 Thanks!!
Author
Owner

@yefenghu commented on GitHub (Oct 14, 2021):

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

@yefenghu commented on GitHub (Oct 14, 2021): You are the most aggressive maintenance developer I've ever seen, although the pan-domain still has duplicate resolution issues
Author
Owner

@qdm12 commented on GitHub (Oct 14, 2021):

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 commented on GitHub (Oct 14, 2021): 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](https://github.com/qdm12/ddns-updater/issues/247#issuecomment-932793121)) please. It can wait a few days, no pressure 😉
Author
Owner

@yefenghu commented on GitHub (Oct 14, 2021):

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 commented on GitHub (Oct 14, 2021): 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?
Author
Owner

@qdm12 commented on GitHub (Oct 15, 2021):

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

@qdm12 commented on GitHub (Oct 15, 2021): Maybe, Try replacing `YOURSUBDOMAIN` with `*`, the URL would look like `https://porkbun.com/api/json/v3/dns/retrieveByNameType/example.com/A/*`
Author
Owner

@yefenghu commented on GitHub (Oct 17, 2021):

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 commented on GitHub (Oct 17, 2021): this is command: ``` curl -X POST -d '{"secretapikey": "sk1_***", "apikey": "pk1_***"}' https://porkbun.com/api/json/v3/dns/retrieveByNameType/mydomain/A/* ``` the results is : ```html <!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> ```
Author
Owner

@qdm12 commented on GitHub (Oct 17, 2021):

🤔 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 commented on GitHub (Oct 17, 2021): 🤔 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!!
Author
Owner

@yefenghu commented on GitHub (Oct 17, 2021):

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

@yefenghu commented on GitHub (Oct 17, 2021): i have try wildcard and domain,subdomains i never setting.need to try subdomains?
Author
Owner

@qdm12 commented on GitHub (Oct 18, 2021):

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 commented on GitHub (Oct 18, 2021): > 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.
Author
Owner

@yefenghu commented on GitHub (Oct 18, 2021):

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

@yefenghu commented on GitHub (Oct 18, 2021): https://github.com/qdm12/ddns-updater/issues/247#issuecomment-945072283 thisi my wildcard record response .i have not use curl command test subdomains.
Author
Owner

@qdm12 commented on GitHub (Oct 19, 2021):

#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 commented on GitHub (Oct 19, 2021): > [#247 (comment)](https://github.com/qdm12/ddns-updater/issues/247#issuecomment-945072283) 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)
Author
Owner

@yefenghu commented on GitHub (Oct 19, 2021):

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 commented on GitHub (Oct 19, 2021): ``` 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. ```
Author
Owner

@yefenghu commented on GitHub (Oct 20, 2021):

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 commented on GitHub (Oct 20, 2021): i try the same command by removing the suffix * at the end . ```json {"status":"SUCCESS","cloudflare":"disabled","records":[{"id":"168081851","name":"mydomain","type":"A","content":"IP","ttl":"600","prio":"0"}]} ```
Author
Owner

@qdm12 commented on GitHub (Oct 20, 2021):

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 commented on GitHub (Oct 20, 2021): > ``` > 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 . > > ```json > {"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??
Author
Owner

@qdm12 commented on GitHub (Feb 20, 2022):

Any update on this?

@qdm12 commented on GitHub (Feb 20, 2022): Any update on this?
Author
Owner

@esackbauer commented on GitHub (Apr 28, 2023):

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 commented on GitHub (Apr 28, 2023): I guess not. For me porkbun is working, but I am not using wildcard. In their [documentation](https://porkbun.com/api/json/v3/documentation#DNS%20Edit%20Record%20by%20Domain,%20Subdomain%20and%20Type) 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.
Author
Owner

@qdm12 commented on GitHub (Jun 12, 2023):

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

@qdm12 commented on GitHub (Jun 12, 2023): Closing this due to inactivity and response from @esackbauer (thanks btw)
Sign in to join this conversation.