Is it possible to read zone with no default ttl in rdataset if there is no ttl in zone file

68 views
Skip to first unread message

julien ortet

unread,
Aug 28, 2019, 9:53:49 AM8/28/19
to dnspython-users
Hello all,

I've got a little problem

for a zone like that :


$TTL 55
@ IN SOA ns.server.net. mail.contact. (2019062500 86400 3600 3600000 60)
IN NS ns.server.net.
IN NS dns.server.net.
target 560 IN A 3.3.3.3
target2 IN A 4.4.4.4

If i use dns.zone.from_text (or file i guess)

in the rdataset for the target2 line there will be ttl=55 even if no ttl is specified in zone file.
Do you think a way to not have this behaviour exist ? And have a dataset without ttl

Thank you

Julien

Bob Halley

unread,
Aug 28, 2019, 10:39:16 AM8/28/19
to dnspython-users
DNS data always has some TTL value, so you cannot load it without one.  If your desire is that the data not be cached, or at least be cached for as short a time as the server is willing to tolerate, then you can specify a TTL of 0.  If my guess about the problem you're trying to solve is wrong, please say more about what you want to do.

/Bob

julien ortet

unread,
Aug 29, 2019, 2:03:52 AM8/29/19
to dnspython-users
Hello,

Thank you for the response Bob.

Yeah you are right, all record have some ttl value.
My goal here, i m hosting some zone and i m writing a script to allow hosted people to import a zone.
What i would like to know, after a from_text, if the ttl is set or not in the imported file.
Of course if there is no ttl set the default one will be used. But actually there is no way to know if the value is written in the file or not ...

Julien

Bob Halley

unread,
Sep 3, 2019, 10:17:26 AM9/3/19
to dnspython-users
dnspython does not preserve whether the TTL was defaulted or not.  Keeping that information would be some effort, as TTL is an rdataset property in the semantics of the DNS, yet it's a per-RR property in masterfiles.

julien ortet

unread,
Sep 4, 2019, 3:11:45 AM9/4/19
to Bob Halley, dnspython-users
Ok, thank you for your answers Bob

Le mar. 3 sept. 2019 à 16:17, Bob Halley <dnsp...@gmail.com> a écrit :
dnspython does not preserve whether the TTL was defaulted or not.  Keeping that information would be some effort, as TTL is an rdataset property in the semantics of the DNS, yet it's a per-RR property in masterfiles.

--
You received this message because you are subscribed to a topic in the Google Groups "dnspython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dnspython-users/B1jHbcR12sg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dnspython-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dnspython-users/8feae717-ec41-4c27-9a6e-bfbef682304e%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages