Skip to content
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

Make "NPM automatically create custom DNS with pihole" an option. #3716

Open
Haui1112 opened this issue Apr 22, 2024 · 0 comments
Open

Make "NPM automatically create custom DNS with pihole" an option. #3716

Haui1112 opened this issue Apr 22, 2024 · 0 comments

Comments

@Haui1112
Copy link

I'm using nginx-proxy-manager and it is one of the greatest tools ever!

I would like to automate the creation of custom DNS Records in Pihole so users can have fully automatic domain creation in a closed off environment.

The API of pihole can do this, here's the documentation: https://github.com/pi-hole/web/blob/6c320a42574f9f0944ded71d84b7331557dbc6ea/api.php

Is your feature request related to a problem? Please describe.
When I create a new proxy host and try it, my computer doesnt route to it since I'm in a closed off home network and pihole needs to know which IP belongs to the domain.

Describe the solution you'd like
I would love to have nginx proxy manager communicate any new, changed and deleted domains directly to pihole if the option is ticked and the contact info (web adress, docker adress, whatever is possible) is ticked.

Describe alternatives you've considered
An alternative would be to have pihole wildcard any subdomains of the base domain to the server IP but this leads to the issue of having to use different domains for different machines which isnt necessary with the above solution.

Additional context
I believe this is the entry of pihole API to talk to:

elseif(isset($_GET['customdns']) && $auth)
{
	if (isset($_GET["auth"])) {
		if ($_GET["auth"] !== $pwhash) {
			die("Not authorized!");
		}
	} else {
		// Skip token validation if explicit auth string is given
		check_csrf($_GET['token']);
	}

	switch ($_GET["action"]) {
		case 'get':
			$data = echoCustomDNSEntries();
			break;

		case 'add':
			$data = addCustomDNSEntry();
			break;

		case 'delete':
			$data = deleteCustomDNSEntry();
			break;

Again the above mentioned documentation: https://github.com/pi-hole/web/blob/6c320a42574f9f0944ded71d84b7331557dbc6ea/api.php

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

No branches or pull requests

1 participant