abh/geodns — pull request #49 by afsheenb (2014-01-08 01:26:15+00:00)
Title: Added support for SRV records, plus documentation and tests

I've added support for SRV records, as well as basic tests and documentation. The result looks good on my dev instance:

$ dig _sip._tcp.test.example.com -t SRV @localhost

; <<>> DiG 9.9.2-P1 <<>> _sip._tcp.test.example.com -t SRV @localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50908
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;_sip._tcp.test.example.com.	IN	SRV

;; ANSWER SECTION:
_sip._tcp.test.example.com. 600	IN	SRV	10 100 5060 sipserver.example.com.

Note: I've used the variable srv_weight to distinguish between the weight that's internal to the SRV record struct vs. the "weight" that other records use. Let me know if this should be changed.