I just want to know if Nginx is able to resolve SRV DNS records when given as the upstream server address. It seems like it's not the case, but maybe there is a workaround if it can't do this out-of-the-box. Thx in advance.
Asked
Active
Viewed 6,085 times
2 Answers
5
Free nginx does not support SRV records.
resolve
and service
keywords for upstream directive are not available in free nginx.
There are some free solutions available,

Volodymyr Linevych
- 365
- 1
- 4
- 11
1
SRV records are not meant to be used like A(ddress) records. In theory it should be possible to hack nginx to resolve SRV records as well but the only advantage I could see is the 'weight' and 'priority' fields used in SRV records.
You can already use this feature in nginx config:
upstream backend {
server backend1.example.com weight=5;
server backend2.example.com:8080;
server unix:/tmp/backend3;
}

Oliver Peter
- 181
- 1
- 6
-
2Nginx and Nginx+ does now resolv SRV record. Nginx have severe caveheat (TTL not taken into account for example) that force to use Nginx+ which is the commercial part of Nginx. I know it's a shame. So Nginx will be superseeded by Vulcand if they continue this strange politic. More informations here : https://www.nginx.com/blog/dns-service-discovery-nginx-plus/ – jmcollin92 Jul 29 '16 at 08:36
-
@jmcollin92 You should post that as an answer. Someone coming to this question might not read the comments and assume it's not possible. – Roman Oct 28 '16 at 18:02