Allow editing existing records on admin/dns_records.php

admin/dns_records.php should include an edit button, rather than requiring me to delete and re-add to fix/update records

(also a duplicate button for faster entry, once edit is there!)

Quick hack to copy the domain and IP back to the input fields if a row is clicked.

This would be easier/cleaner if there was a way to distinguish a header row from a data row.

var domainInput = document.querySelector('#domain');
var addressInput = document.querySelector('#ip');
    row => {
        if (row.children[0].tagName == "TH") {
            console.log("skipped header");
        console.log("got tr");
            function(e) {
                domainInput.value = row.children[0].textContent;
                addressInput.value = row.children[1].textContent;

While this is not really fulfilling your request, let me mention that in the new Pi-hole v6.0 (currently in late beta phase), you have an option to modify DNS records directly in a HOSTS-like format (All settings menu):

Screenshot from 2024-01-28 22-14-48

The latter - at the very least - allows easy copy-paste mass editing of records.

Where is that option? I have upgraded to the 6.0 beta and can't find it at all.

You need to access the Expert settings:

  • Go to Settings page (any settings page will do);
  • Use the toggle (near the page title) to change the settings level to Expert. This will show 2 extra Expert settings pages on the menu;
  • now, open Local DNS Records page and use the list to edit the records:

You can also use the All Settings page to edit the records using this field:

  • Screenshot from 2024-01-28 22-14-48