Skip to content

Commit

Permalink
TTL updated
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobg committed Sep 3, 2019
1 parent 11e6035 commit e70e7df
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions dnsserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,17 @@ def resolve(self, request, handler):
r = RR(
rname=request.q.qname,
rdata=dns.A(confs.LOCAL_IPV4),
rtype=QTYPE.A
rtype=QTYPE.A,
ttl=60*60
)
reply.add_answer(r)

if self.SOA:
r = RR(
rname=request.q.qname,
rdata=self.SOA,
rtype=QTYPE.SOA
rtype=QTYPE.SOA,
ttl=60*60
)
reply.add_answer(r)

Expand All @@ -125,15 +127,17 @@ def resolve(self, request, handler):
r = RR(
rname=request.q.qname,
rdata=i,
rtype=QTYPE.NS
rtype=QTYPE.NS,
ttl=60*60
)
reply.add_answer(r)

if confs.LOCAL_IPV6:
r = RR(
rname=request.q.qname,
rdata=dns.AAAA(confs.LOCAL_IPV6),
rtype=QTYPE.AAAA
rtype=QTYPE.AAAA,
ttl=60*60
)
reply.add_answer(r)

Expand Down Expand Up @@ -162,7 +166,8 @@ def resolve(self, request, handler):
r = RR(
rname=request.q.qname,
rdata=dns.A(ipv4),
rtype=QTYPE.A
rtype=QTYPE.A,
ttl=24*60*60
)
reply.add_answer(r)
else:
Expand All @@ -176,7 +181,8 @@ def resolve(self, request, handler):
r = RR(
rname=request.q.qname,
rdata=dns.AAAA(ipv6),
rtype=QTYPE.AAAA
rtype=QTYPE.AAAA,
ttl=24*60*60
)
reply.add_answer(r)
except:
Expand Down

0 comments on commit e70e7df

Please sign in to comment.