From b0fa22507fa12f222139a5c835eba51217fe7aae Mon Sep 17 00:00:00 2001 From: Casey Lee Date: Fri, 10 Aug 2018 20:15:25 +0000 Subject: [PATCH] configure DNS search --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ea96b05..831a102 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -56,7 +56,7 @@ def nodejs_uri # Resolve the SRV records for the hostname in the URL def expand_url(url) uri = URI(url) - resolver = Resolv::DNS.new() + resolver = Resolv::DNS.new(:search => [ENV["_SERVICE_DISCOVERY_NAME"]]) srv = resolver.getresource("_#{uri.scheme}._tcp.#{uri.host}", Resolv::DNS::Resource::IN::SRV) uri.host = srv.target.to_s uri.port = srv.port.to_s