Skip to content

dns_opnsense.sh with OPNsense 25.7 fails on _get_root #6467

@koelle25

Description

@koelle25

It seems with OPNsense release 25.7 they changed the BIND API again.

Therefore the following line, i.e. the _egrep_o, returns an empty result:

id=$(echo "$_domain_response" | _egrep_o "\"uuid\":\"[a-z0-9\-]*\",\"enabled\":\"1\",\"type\":\"primary\",\"domainname\":\"${h}\"" | cut -d ':' -f 2 | cut -d '"' -f 2)

The current API response is, e.g.:

{
	"rows": [
		{
			"uuid": "ad260e98-952f-47d8-a638-79a51803a8d1",
			"enabled": "1",
			"type": "primary",
			"primaryip": "",
			"forwardserver": "",
			"transferkeyalgo": "",
			"%transferkeyalgo": "None",
			"transferkeyname": "",
			"transferkey": "",
			"allownotifysecondary": "",
			"domainname": "example.com",
			"allowtransfer": "",
			"%allowtransfer": "",
			"allowrndctransfer": "0",
			"allowquery": "d66ade93-4d6b-4122-8c3f-8b4d16d31367",
			"%allowquery": "everyone",
			"allowrndcupdate": "1",
			"serial": "2507310605",
			"ttl": "300",
			"refresh": "3600",
			"retry": "900",
			"expire": "86400",
			"negative": "3600",
			"mailadmin": "support.example.com",
			"dnsserver": "ns1.example.com"
		},
		{
			"uuid": "eb1490ef-53b5-41ac-ac13-14132a4fda29",
			"enabled": "1",
			"type": "primary",
			"primaryip": "",
			"forwardserver": "",
			"transferkeyalgo": "",
			"%transferkeyalgo": "None",
			"transferkeyname": "",
			"transferkey": "",
			"allownotifysecondary": "",
			"domainname": "example.net",
			"allowtransfer": "",
			"%allowtransfer": "",
			"allowrndctransfer": "0",
			"allowquery": "d66ade93-4d6b-4122-8c3f-8b4d16d31367",
			"%allowquery": "everyone",
			"allowrndcupdate": "1",
			"serial": "2507310605",
			"ttl": "300",
			"refresh": "3600",
			"retry": "900",
			"expire": "86400",
			"negative": "3600",
			"mailadmin": "support.example.net",
			"dnsserver": "ns1.example.net"
		}
	],
	"rowCount": 2,
	"total": 2,
	"current": 1
}

I already have a working solution for this and will post a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions