使用dns srv记录的服务查找
srvlookup的Python项目详细描述
一个小包装器,用于dnspython返回给定主机、协议的srv记录, 以及域名作为一个名偶列表。
示例
>>>importsrvlookup>>>srvlookup.lookup('api','memcached')[SRV(host='192.169.1.100',port=11211,priority=1,weight=0,host='memcache1.local'),SRV(host='192.168.1.102',port=11211,priority=1,weight=0,host='memcache2.local'),SRV(host='192.168.1.120',port=11211,priority=1,weight=0,host='memcache3.local'),SRV(host='192.168.1.126',port=11211,priority=1,weight=0,host='memcache4.local')]>>>
测试
python setup.py nosetests