There is any difference between this zone syntax?

Mario Nette

I'd like to build bind zone files via Ansible. To decide how to structure the jinja2 template I need to know if there is any difference in any of these zone configurations:

1.) good old fashioned way:

$ORIGIN foo.bar.
@       IN      SOA     dns.foo.bar. hostmaster.foo.bar. (
                        2018111601
                        3H
                        1H
                        604800
                        86400)

        86400   IN      NS      ns01.foo.bar.
        86400   IN      NS      ns02.foo.bar.

www             IN      A       10.0.0.1

-

2.) Do I have to specify $ORIGIN if the zone name is already foo.bar?

from named.conf:

zone "foo.bar" in{
    type master;
    file "zones/foo.bar";
};

from zones/foo.bar:

@       IN      SOA     dns.foo.bar. hostmaster.foo.bar. (
                        2018111601
                        3H
                        1H
                        604800
                        86400)

        86400   IN      NS      ns01.foo.bar.
        86400   IN      NS      ns02.foo.bar.

www             IN      A       10.0.0.1

-

3.) Split-up apex and use '@' multiple times

$ORIGIN foo.bar.
@       IN      SOA     dns.foo.bar. hostmaster.foo.bar. (
                        2018111601
                        3H
                        1H
                        604800
                        86400)

www             IN      A       10.0.0.1

@       86400   IN      NS      ns01.foo.bar.
@       86400   IN      NS      ns02.foo.bar.

-

4.) No use of '@' placeholder

foo.bar.       IN      SOA     dns.foo.bar. hostmaster.foo.bar. (
                        2018111601
                        3H
                        1H
                        604800
                        86400)

foo.bar.       86400   IN      NS      ns01.foo.bar.
foo.bar.       86400   IN      NS      ns02.foo.bar.

$ORIGIN foo.bar.
www             IN      A       10.0.0.1

-

I always want this as answer:

$ dig foo.bar ANY +noall +answer
foo.bar.    1784    IN  SOA dns.foo.bar. hostmaster.foo.bar. 2018121401 10800 3600 604800 86400
foo.bar.    86384   IN  NS  ns01.foo.bar.
foo.bar.    86384   IN  NS  ns02.foo.bar.

$ dig www.foo.bar +short
10.0.0.1

Question:

  • Do all variants results in the same dns answer?
derobert

Answer: yes, they're all the same. Though note I haven't actually loaded these zones in to a DNS server to confirm; e.g., I may have missed a typo when reading the question. Load them in to a DNS server, allow zone transfers, and then transfer them — you should get the exact same result.

Details:

  • If you check “Other Zone File Directives” in the BIND9 manual, $ORIGIN defaults to the zone you specify in named.conf. Mainly you'd using $ORIGIN in manually-written files e.g., to make it easier to deal with subdomains ($ORIGIN subdmain.domain.com., then define all your records for the subdomain).

  • Same section tells you that @ is a shortcut for the current origin. So spelling it out is exactly the same thing.

  • When you specify two records for the same name in a row without repeating the name, the second record just implicitly uses the last one's name. To quote RFC 1035 (which calls the name the record's owner):

    The last two forms represent RRs. If an entry for an RR begins with a blank, then the RR is assumed to be owned by the last stated owner. If an RR entry begins with a <domain-name>, then the owner name is reset.

    (BTW: $ORIGIN and @ are in the RFC as well, so they should apply to servers other than BIND that use the same zone file format. I just used the BIND manual to get terminology newer than 1987.)

These are all convenience features of the "master file" format — they have nothing to do with the DNS wire protocol. They don't even survive loading the file into BIND (if you have bind rewrite the zone file, e.g., due to allowing DNS updates, then you'll find it'll rewrite the file much closer to your #4).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Difference Between jQuery Syntax

From Dev

Difference Between jQuery Syntax

From Dev

Is there any difference between $@ and "$@"?

From Dev

Difference (if there is any) between ` and ' in javascript

From Dev

Is there any difference between vbNullString and ""?

From Dev

is there any difference between the queries

From Dev

is there any syntax for non-recursive binding in Haskell, just like the difference between `let` and `let rec` in similar languages?

From Dev

Besides syntax, is there any difference between writing an initialization method as an instance or class method?

From Dev

difference between a DNS zone and DNS domain

From Dev

Is there a difference between `syntax on` and `syntax enable` in vimscript?

From Dev

What is the difference between standard syntax and BSD syntax?

From Dev

What is the difference between standard syntax and BSD syntax?

From Dev

Difference between lexical and syntax error

From Dev

Difference between Java generics syntax?

From Dev

What is the difference between these two syntax?

From Dev

Gem versioning: difference between syntax?

From Dev

Is there any difference between QRegularExpression and QRegExp?

From Dev

Is there any difference between these two loops?

From Java

Difference between "*" and "Any" in Kotlin generics

From Java

Is there any difference between a GUID and a UUID?

From Dev

Is there any difference between type and class?

From Dev

Is there any difference between `*x` and `x*`?

From Dev

Is there any difference between Activityname.this() & this?

From Dev

Is there any technical difference between these methods?

From Dev

Is there any difference between sql linq

From Dev

Difference between Future[Any] and Future[_]

From Dev

Any difference between '+' and '&' for String concatenation?

From Dev

What is the difference between `mixed` and `any`?

From Dev

Is there any difference between Pickling and Serialization?

Related Related

  1. 1

    Difference Between jQuery Syntax

  2. 2

    Difference Between jQuery Syntax

  3. 3

    Is there any difference between $@ and "$@"?

  4. 4

    Difference (if there is any) between ` and ' in javascript

  5. 5

    Is there any difference between vbNullString and ""?

  6. 6

    is there any difference between the queries

  7. 7

    is there any syntax for non-recursive binding in Haskell, just like the difference between `let` and `let rec` in similar languages?

  8. 8

    Besides syntax, is there any difference between writing an initialization method as an instance or class method?

  9. 9

    difference between a DNS zone and DNS domain

  10. 10

    Is there a difference between `syntax on` and `syntax enable` in vimscript?

  11. 11

    What is the difference between standard syntax and BSD syntax?

  12. 12

    What is the difference between standard syntax and BSD syntax?

  13. 13

    Difference between lexical and syntax error

  14. 14

    Difference between Java generics syntax?

  15. 15

    What is the difference between these two syntax?

  16. 16

    Gem versioning: difference between syntax?

  17. 17

    Is there any difference between QRegularExpression and QRegExp?

  18. 18

    Is there any difference between these two loops?

  19. 19

    Difference between "*" and "Any" in Kotlin generics

  20. 20

    Is there any difference between a GUID and a UUID?

  21. 21

    Is there any difference between type and class?

  22. 22

    Is there any difference between `*x` and `x*`?

  23. 23

    Is there any difference between Activityname.this() & this?

  24. 24

    Is there any technical difference between these methods?

  25. 25

    Is there any difference between sql linq

  26. 26

    Difference between Future[Any] and Future[_]

  27. 27

    Any difference between '+' and '&' for String concatenation?

  28. 28

    What is the difference between `mixed` and `any`?

  29. 29

    Is there any difference between Pickling and Serialization?

HotTag

Archive