Add explicit DNS timeout

This makes DNS timeouts occur much more quickly and avoid clients with nonfunctional reverse DNS timing out while waiting for a response to their EHLO requests.
This commit is contained in:
Grex
2022-08-17 11:13:24 +01:00
committed by GitHub
parent 9f0697f194
commit 6bace2c905
+4 -1
View File
@@ -105,7 +105,10 @@ module Postal
private
def resolve_hostname
@hostname = Resolv.new.getname(@ip_address) rescue @ip_address
Resolv::DNS.open do |dns|
dns.timeouts = [10,5]
@hostname = dns.getname(@ip_address) rescue @ip_address
end
end
def proxy(data)