SDN Simple network with pve IPAM and PowerDNS

markc

Active Member
Sep 12, 2020
61
13
28
70
Gold Coast, Australia
spiderweb.com.au
I have this mostly working so that when I create a new VM/CT it gets assigned a new IP via DHCP and an A record for the hostname (+ domain) and the assigned IP gets inserted into the pdns sqlite database. Great, that was a hard won battle with the help of Claude.ai. However, the PTR record can't be inserted because of an incorrect zone and for the life of me I cannot find where I configure the reverse zone. Example...
Code:
Tue Jan 14 23:47:44 2025 daemon.info pdns[5788]: gsqlite3: connection to '/etc/powerdns/pdns.db' successful
Tue Jan 14 23:47:44 2025 daemon.notice pdns[5788]: [webserver] 9be2fd50-4ff2-47a1-a097-f887e02d66ea 192.168.1.23:39060
 "GET /api/v1/servers/localhost/zones/10.in-addr.arpa. HTTP/1.1" 404 114
The above should be going to a 2.2.10.in-addr.arpa zone for a 10.2.2.0/24 network, not 10.in-addr.arpa. I did have a 10.in-addr.arpa available so the VM/CT allocation would succeed but the forward and reverse DNS lookups would not match so that was useless. When I removed that incorrect zone I started getting the above error and VM/CT creation would fail.

Any hints would be appreciated but particularly how to define the PTR zone to be used Some configs from /etc/pve/sdn/* and the current pve-ipam-state.json...
Code:
powerdns: OpenWRT
        key 409c15e2f70760a3
        url http://192.168.1.233:8081/api/v1/servers/localhost
        ttl 300

subnet: simple-10.2.2.0-24
        vnet vnet3
        dhcp-range start-address=10.2.2.200,end-address=10.2.2.250
        gateway 10.2.2.1
        snat 1

vnet: vnet3
        zone simple
        alias Simple Network

simple: simple
        dhcp dnsmasq
        dns OpenWRT
        dnszone sub.lan
        ipam pve
        reversedns OpenWRT
Code:
pve3 /etc cat /etc/pve/sdn/pve-ipam-state.json | jq .
{
  "zones": {
    "myevpn": {
      "subnets": {}
    },
    "evpn1": {
      "subnets": {
        "10.1.1.0/24": {
          "ips": {
            "10.1.1.1": {
              "gateway": 1
            }
          }
        }
      }
    },
    "simple": {
      "subnets": {
        "10.2.2.0/24": {
          "ips": {
            "10.2.2.207": {
              "mac": "BC:24:11:1C:3C:96",
              "hostname": "ctd7",
              "vmid": "119"
            },
            "10.2.2.201": {
              "hostname": "ctd3.sub",
              "mac": "BC:24:11:85:17:E9",
              "vmid": "102"
            },
            "10.2.2.203": {
              "vmid": "104",
              "hostname": "ctd1.sub",
              "mac": "BC:24:11:96:BA:6E"
            },
            "10.2.2.1": {
              "gateway": 1
            },
            "10.2.2.202": {
              "vmid": "105",
              "mac": "BC:24:11:4A:C5:7F",
              "hostname": "ctd2.sub"
            },
            "10.2.2.200": {
              "vmid": "101",
              "mac": "BC:24:11:43:92:41",
              "hostname": "ctwrt.sub"
            },
            "10.2.2.206": {
              "vmid": "119",
              "mac": "BC:24:11:68:60:5A",
              "hostname": "ctd8.sub"
            },
            "10.2.2.205": {
              "hostname": "ctd7.sub",
              "mac": "BC:24:11:93:2D:63",
              "vmid": "119"
            },
            "10.2.2.204": {
              "vmid": "104",
              "hostname": "ctd6.sub",
              "mac": "BC:24:11:C0:B5:9F"
            }
          }
        }
      }
    },
    "Private": {
      "subnets": {}
    },
    "vxlan1": {
      "subnets": {
        "10.2.2.0/24": {
          "ips": {
            "10.2.2.1": {
              "gateway": 1
            }
          }
        }
      }
    }
  }
}