I have Ubuntu 18.04, Nginx 1.17.4 VPS. This server supports IPv4 and IPv6. Although nginx.conf has only IPv4 DNS resolver. Then, I have added IPv6 to this server in following way. But there's no any backup DNS resolvers.

resolver [2606:4700:4700::1111] valid=10m;

I would like to know that, are there any possibility to add backup DNS address (both IPv4 and IPv6) for configuration?

Is this configuration correct?

  • 1
    That seems the right syntax for multiple resolvers. You can add more (separated by spaces) but please be aware that there is no such thing as "backup" resolvers, name servers are queried in a round-robin fashion. ("Before version 1.1.7, only a single name server could be configured. Specifying name servers using IPv6 addresses is supported starting from versions 1.3.1 and 1.2.2.")
    – HBruijn
    Oct 7, 2019 at 12:10
  • 1
    Thank you for your explanation. If I added [IPv4] [IPv6] [IPv4] [IPv6] DNS resolvers nginx automatically select each IPv4 and IPv6 DNS resolvers based on visitors IP address? Or I have to distinguished DNS resolvers?
    – Chathu
    Oct 13, 2019 at 18:08
  • @Chathu That's a good question. Did you find out?
    – Houman
    Dec 2, 2021 at 11:31
  • 1
    @Houman, I use this resolver [2606:4700:4700::1111] [2606:4700:4700::1001] valid=300s ipv6=on;
    – Chathu
    Dec 5, 2021 at 17:01


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.