Added support for use_srv_records and srv_domain

Rebase of #172 with tests and documentation.