This has now all been fixed in version 1.28+ - see: https://blog.nginx.org/blog/dynamic-dns-resolution-open-sourced-in-nginx
If you carefully follow the instructions, it will work. The only thing not mentioned in there is that you need to have the resolver/resolve in a shared memory zone so child processes can access it.