paulc / dnslib

A Python library to encode/decode DNS wire-format packets
https://github.com/paulc/dnslib
BSD 2-Clause "Simplified" License
295 stars 84 forks source link

Support for SRV Records for High Service Availability (multiple entries of same service with different priorities) #20

Closed amard33p closed 3 years ago

amard33p commented 3 years ago

From https://en.wikipedia.org/wiki/SRV_record

Provisioning for high service availability

The priority field determines the precedence of use of the record's data. Clients should use the SRV records with the lowest-numbered priority value first, and fall back to records of higher value if the connection fails. If a service has multiple SRV records with the same priority value, clients should load balance them in proportion to the values of their weight fields. In the following example, both the priority and weight fields are used to provide a combination of load balancing and backup service.

# _service._proto.name.  TTL   class SRV priority weight port target.
_sip._tcp.example.com.   86400 IN    SRV 10       60     5060 bigbox.example.com.
_sip._tcp.example.com.   86400 IN    SRV 10       20     5060 smallbox1.example.com.
_sip._tcp.example.com.   86400 IN    SRV 10       20     5060 smallbox2.example.com.
_sip._tcp.example.com.   86400 IN    SRV 20       0      5060 backupbox.example.com.

Is this supported in dnslib?

paulc commented 3 years ago

This is a question not an issue - if you look at the code you can see that SRV records are supported

https://github.com/paulc/dnslib/blob/55abd30efc02bafbc633df96720db2029de91cf6/dnslib/dns.py#L1383

amard33p commented 3 years ago

Please do let me know which is an appropriate forum for asking questions related to dnslib.

As for the request, I know that SRV records are supported. Just wanted to know if SRV records for High Service Availability is supported too.