-
-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API call to modify local DNS and CNAME records #2091
Conversation
Signed-off-by: Alexandr Salamatov <wpgnetworks@gmail.com>
Signed-off-by: Alexandr Salamatov <wpgnetworks@gmail.com>
Signed-off-by: Alexandr Salamatov <wpgnetworks@gmail.com>
I don't know if I'm missing anything here... but it I just get redirected to the dashboard when making GET requests to the above example API endpoints: e.g
|
I absolutely was missing something (but so were your example URLs - I've updated your OP to reflect)
After figuring that out, can confirm this does what it says it does |
Thanks and sorry for confusion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we need to document the new API anywhere?
Most likely, however I couldn't find documentation for existing API, could you point me to it? |
I could not find it, too. We'll have a much better documented API with v6 one day.... |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-14-web-v5-11-and-core-v5-9-released/53529/1 |
@yubiuser Thanks for this. Question: I'm getting a response like this:
which is not valid JSON due to the In theory, something like the response below would be ideal, though just having the [] removed would be enough for now. Is it possible to fix this?
Thanks 😄 |
Signed-off-by: Alexandr Salamatov wpgnetworks@gmail.com
By submitting this pull request, I confirm the following:
{please fill any appropriate checkboxes, e.g: [X]}
{Please ensure that your pull request is for the 'devel' branch!}
git rebase
)git commit --signoff
)What does this PR aim to accomplish?:
Add API call to manage custom DNS and CNAME records
How does this PR accomplish the above?:
Add new DNS record
http://ADDRESSOFPIHOLE/admin/api.php?customdns&action=add&ip=IPADDRESS&domain=youdomain&auth=XXX
Delete existing DNS record
http://ADDRESSOFPIHOLE/admin/api.php?customdns&action=delete&ip=IPADDRESS&domain=youdomain&auth=XXX
List existing DNS records
http://ADDRESSOFPIHOLE/admin/api.php?customdns&action=get&auth=XXX
Add new CNAME record
http://ADDRESSOFPIHOLE/admin/api.php?customcname&action=add&domain=YOURCNAME&target=TARGETDOMAIN&auth=XXX
Delete existing CNAME record
http://ADDRESSOFPIHOLE/admin/api.php?customcname&action=delete&domain=YOURCNAME&target=TARGETDOMAIN&auth=XXX
List existing CNAME records
http://ADDRESSOFPIHOLE/admin/api.php?customcname&action=get&auth=XXX
What documentation changes (if any) are needed to support this PR?: