[Pdns-users] LUA SRV records

George Asenov george.asenov at wpxhosting.com
Mon May 29 13:44:17 UTC 2023


Hello community,

I already searched the documentation but couldn't find an answer to my 
questions.

Is it possible to add LUA SRV record which will return different weight 
based on query source IP address?

Are LUA SRV records supported at all?


I have tried one and it logs strange error:
pdns_server: Lua record (_k8splanes._tcp.example1.com|SRV) reported: 
Parsing record content (try 'pdnsutil check-zone'): missing field at the 
end of record content ''

#######################################################################
  pdnsutil check-zone example1.com
May 29 08:36:01 gmysql Connection successful. Connected to database 
'pdns' on 'localhost'.
May 29 08:36:01 gmysql Connection successful. Connected to database 
'pdns' on 'localhost'.
Checked 5 records of 'example1.com', 0 errors, 0 warnings.


#######################################################################
  pdnsutil list-zone example1.com
May 29 08:37:12 gmysql Connection successful. Connected to database 
'pdns' on 'localhost'.
May 29 08:37:12 gmysql Connection successful. Connected to database 
'pdns' on 'localhost'.
$ORIGIN .
example1.com    38400   IN      NS      ns1.somedomain.com.
example1.com    38400   IN      SOA     ns1.somedomain.com 
root.v1.domain.net 2023052313 10800 3600 604800 38400
k8s-plane1.example1.com 30      IN      A       YY.YY.YY.YY
www.example1.com        600     IN      LUA     A 
"pickclosest({'192.0.2.1','192.0.2.2','198.51.100.1'})"
_k8splanes._tcp.example1.com    30      IN      LUA     SRV "view({ { 
{'55.55.55.55/26'}, {'1 6444 k8s-plane1.example1.com'}},{ 
{'66.66.66.66/24'}, {'5 6444 k8s-plane1.example1.com'}}})"

#######################################################################
dig _k8splanes._tcp.example1.com SRV @XX.XX.XX.XX

; <<>> DiG 9.16.5 <<>> _k8splanes._tcp.example1.com SRV @XX.XX.XX.XX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 27248
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;_k8splanes._tcp.example1.com.  IN      SRV

;; Query time: 121 msec
;; SERVER: XX.XX.XX.XX#53(XX.XX.XX.XX)

#######################################################################
dig www.example1.com  A  @208.100.34.165

; <<>> DiG 9.16.5 <<>> www.example1.com A @XX.XX.XX.XX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36785
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.example1.com.              IN      A

;; ANSWER SECTION:
www.example1.com.       600     IN      A       192.0.2.1

;; Query time: 123 msec
;; SERVER: XX.XX.XX.XX#53(XX.XX.XX.XX)
;; WHEN: Mon May 29 16:42:54 FLE Daylight Time 2023
;; MSG SIZE  rcvd: 61

#######################################################################


A record works as it should but SRV don't.



More information about the Pdns-users mailing list