Isaksson / node-red-contrib-unifi

MIT License
50 stars 19 forks source link

request to set DNS via node red #114

Closed MHagreis closed 11 months ago

MHagreis commented 11 months ago

I'm reaching out to you with a request, sorry did not know any other way then creating a issue :-(,

I like your input on an enhancement to the Node-RED plugin.

Currently, my network infrastructure relies on the Unifi UDM Controller to manage DHCP and DNS services. We've set our primary DNS to our Pi-hole server, which has been effective in blocking unwanted ads and boosting security. However, we've identified a potential vulnerability in the scenario of a Pi-hole failure. A crash in the Pi-hole could result in disrupted DNS resolution, problems

Here's what we have in mind and why I ask your assistance:

Primary DNS Configuration: We're looking to enhance the Node-RED plugin for the Unifi UDM Controller's DHCP settings. Our aim is to enable an option to configure two DNS servers for our client devices. The first server would remain our Pi-hole, serving as the primary DNS for its valuable ad-blocking and security features.

DNS Health Monitoring: We have the Node-RED plugin monitoring the health of the Pi-hole server at regular intervals. If it detects any unresponsiveness, then we trigger a event to change the DNS in de UDM form the Pi-hole to 1.1.1.1 This automated failover mechanism would ensure our network remains stable during Pi-hole outages.

is this a possibility or not?

Isaksson commented 11 months ago

Hello. Creating a issue is completely fine for this kind of request. I would have to take a look about this and I will update you in this post.

Isaksson commented 11 months ago

Is it the DHCP DNS server that would like to modify?

image

MHagreis commented 11 months ago

Yes indeed it is the dhcp DNS

Maarten Hagreis


From: Kristoffer Isaksson @.> Sent: Wednesday, August 30, 2023 6:54:28 PM To: Isaksson/node-red-contrib-unifi @.> Cc: Maarten @.>; Author @.> Subject: Re: [Isaksson/node-red-contrib-unifi] request to set DNS via node red (Issue #114)

Is it the DHCP DNS server that would like to modify?

[image]https://user-images.githubusercontent.com/4119080/264416191-3250e564-b253-431f-9a17-9bbcccdeecad.png

— Reply to this email directly, view it on GitHubhttps://github.com/Isaksson/node-red-contrib-unifi/issues/114#issuecomment-1699532293, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AL7PWGHMITGXVMA7IQ66WRDXX5V4JANCNFSM6AAAAAA4BNYKX4. You are receiving this because you authored the thread.Message ID: @.***>

Isaksson commented 11 months ago

Sounds good, this is possible and I will implement this feature.

Isaksson commented 11 months ago

Version 0.3.6 contains the new command to change the DNS server for a specific network. Here is an example to change the DNS 1 and DNS 2 server for one specific network msg.payload = { command: "setdnsserver", network_id: "63e28bc860dd452c2deeca31", dns1: "10.0.0.1", dns2: "8.8.8.8"}

You could view your network settings and get the network_id parameter from this command msg.payload = { command: "getnetworkconf"}

You could change DNS1 or DNS2 or both at the same time. Let me know what you think about this solution.

MHagreis commented 11 months ago

I will test to night thanks for your support and will let you know the result.

Just tested it and can confirm it works as I wished, really apricated 🥇

can I buy you a cup of coffee?

Isaksson commented 11 months ago

Perfect. I hope you will benefit greatly from this feature, at least your clients that don't loose internet connection :)

Its always possible to be a sponsor to support this project (don't have to be monthly could select One-time) https://github.com/sponsors/Isaksson