SRV records, also known as Service records in DNS helps clients find services in the domain. A best example of this is with the Windows Active Directory where the SRV records are used to locate the Domain Controllers.
SRV records can also help Load Balancing between multiple resources providing the same service. For example, if there are more than one web servers in the Domain then they can be load balanced using the SRV records.
Let's for example there are four servers in the Domains serving the website and the records look like the following:
_http._tcp.itsyourip.com. 86400 IN SRV 10 50 80 web1.itsyourip.com. _http._tcp.itsyourip.com. 86400 IN SRV 10 30 80 web2.itsyourip.com. _http._tcp.itsyourip.com. 86400 IN SRV 10 20 80 web3.itsyourip.com. _http._tcp.itsyourip.com. 86400 IN SRV 20 60 0 backup.itsyourip.com.
Here, the SRV records for web1,web2,web3 all have the priority set the same at "10" while backup has the priority set as 20. This means the web1,web2,web3 all have the least priority number and hence will be forwarded with the web requets. The backup server with priority 20 means that it will get the requests forwarded only when all the servers with the priority "10" went down or are not responding. This is exactly how it works with the MX records as well.
Now, the priority "10" servers have weight set as follows:
web1 = 50
web2 = 30
web3 = 20
Here, of the 100% of the requests, 50% of it will be served as to web1 based on the weight while web2 will be served 30% of the time while 20% of the requests will be served by web3.
If all the priority "10" servers fail then the backup server with priority "20" will become the sole server which be served all the time.
Although not the very best way to provide Load Balancing solutions, it still can be used as one way of doing it.
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Do DNS SRV records actually work with IE and Firefox browsers?
I’m thinking of using this to make the move from one physical server to another more seamless.
Sarel, you’ve hit the mark. Exactly that’s the problem about IN SRV DNS RRs. They are nice for new protocols (XMPP aka Jabber includes it in the specs as a requirement and on IM this is especially usefull.), but tcpdumping reveals that neither Firefox nor Opera does _http._tcp IN SRV lookups…. so leaving this fact out of scope renders this article completely useless.
BTW – I would dream about a world where DNS reflects that “Services” have got nothing to do with the “Host” it’s running on (“currently”…).
Problems attempting to resolve SRV in Solaris 10?