0

Using bind 9.18, my named.conf has something like this:

zone "my-domain.com" {
  type master;
  file "/usr/local/etc/namedb/master/my-domain.com.zone";
};

zone "32/29.114.115.116.IN-ADDR.ARPA" {
  type master;
  file "/usr/local/etc/namedb/master/my-domain.com.rev";
};

In the zone file, both ipv4 and ipv6 addresses may be present, and may represent the same host:

my-domain.com. IN A 116.115.114.32
ns.my-domain.com.               IN A 116.115.114.32
my-domain.com. IN AAAA ::ffff:7473:7220
ns.my-domain.com.               IN AAAA ::ffff:7473:7220

Is it necessary to explicitly define the IPv6 AAAA record when it matches the IPv4 address?

My freebsd 12.4 bind 9.18 install has a single localhost-reverse file; there are two entries in named.conf referring to the same reverse file:

zone "127.in-addr.arpa" { type primary; file "/usr/local/etc/namedb/primary/localhost-reverse.db"; };
zone "0.ip6.arpa"   { type primary; file "/usr/local/etc/namedb/primary/localhost-reverse.db"; };

The reverse file looks like:

$TTL 3h
@ SOA localhost. nobody.localhost. 42 1d 12h 1w 3h
    NS  localhost.
1.0.0   PTR localhost.
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR localhost.

How would the above example for my-domain.com be expressed in a single reverse file?

I get something like this:

named.conf:
  zone "114.115.116.IN-ADDR.ARPA" {type master; file "..."; }
  zone "7.2.7.3.7.4.f.f.f.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.arpa" {type master; file "..."; }
reverse-zone file:
  $TTL 3h
  @ SOA ns.my-domain.com. root.my-domain.com. 42 1d 12h 1w 3h
      IN  NS  ns.my-domain.com.
    32      IN      PTR     ns.my-domain.com.
    0.2     IN      PTR     ns.my-domain.com.

Would the above be correct?

Is it necessary to explicitly define the ipv6 reverse map when it matches the IPv4 address?

Gary Aitken
  • 123
  • 6
  • 3
    How can IPv6 reverse address match IPv4 reverse address? I don't understand the premise of the question. – vidarlo May 26 '23 at 20:02
  • @vidarlo by match I mean use one of the ipv6 forms that embed the ipv4 addr, e.g. ::ffff:abcd:efgh or the equivalent for reverse. – Gary Aitken May 27 '23 at 03:04
  • I'd echo @vidario with what do you mean? IPv4 and IPv6 are completely separate, they don't "match". At best if you had say `1.2.3.4` you might choose to set your v6 address as a:b:c:d:1:2:3:4, but that's purely for human convenience, they're not inheritently linked as far as the computer is concerned, and could just as well be set to point to completely different destinations. – Keith Langmead May 27 '23 at 04:55

1 Answers1

1

Is it necessary to explicitly define the IPv6 AAAA record when it matches the IPv4 address?

It can't ever match an IPv4 address. The address format is simply different; IPv6 addresses are 128 bit; IPv4 32 bits. Furthermore, the lookup format ain't even the same.

How would the above example for my-domain.com be expressed in a single reverse file?

It can't be. Due to the different formats.

vidarlo
  • 6,654
  • 2
  • 18
  • 31