Sunday, July 5, 2015

domain name system - unbound forward zone syntax



I want to configure unbound to lookup certain domain names with an alternative dns server, with forward-zone. The documentation I find have two syntaxes:



forward-zone:
name: "mynetwork.com."
forward-addr: 10.0.0.1



e.g. here or



forward-zone:
name: "mynetwork.com"
forward-addr: 10.0.0.1


i.e. name field without dot at the end, e.g. here. Both seems to work for me, but what's the difference between foo.tld vs foo.tld.?


Answer




In the specific context stated in the question, the name in a zone definition (forward-zone, local-zone, etc) in unbound.conf, I don't believe there can be any difference to how these variations are interpreted.
Ie, these two names are interpreted the same.



In some other contexts, a name lacking the trailing dot is considered relative. Here, however we are in a context where there exists no reference point for what the name would be relative to.



It may be a good idea to use the variation with the trailing dot simply for its completely unambiguous meaning to any human readers of the unbound configuration file.
Additionally, It may be nice in terms of consistency if that name is also referenced somewhere else where names can actually be relative and therefore has the trailing dot in that other place.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...