Project

General

Profile

Actions

Feature #2790

closed

Optional setting for custom DNS TTL value in settings.yml

Added by Povilas Daukintis over 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
DNS
Target version:
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

Description

When smart-proxy manipulates DNS zone records (A/PTR) by default it will use TTL value which is 86400. While it's pretty good for most cases, it might be not suitable for every possible case.

I've slightly modified lib/proxy/dns.rb code to optionally read custom TTL value from settings.yml file:

diff --git a/lib/proxy/dns.rb b/lib/proxy/dns.rb
index f580116..5d4d924 100644
--- a/lib/proxy/dns.rb
+++ b/lib/proxy/dns.rb
@@ -7,7 +7,7 @@ module Proxy::DNS
     def initialize options = {}
       @server = options[:server] || "localhost" 
       @fqdn   = options[:fqdn]
-      @ttl    = options[:ttl]    || "86400" 
+      @ttl    = options[:ttl]    || SETTINGS.dns_ttl || "86400" 
       @type   = options[:type]   || "A" 
       @value  = options[:value]

This would allow to set custom TTL value per smart-proxy instance.

Actions

Also available in: Atom PDF