Creating PTR Records when using VYOS as DNS Server

I’m using vyos as a router, firewall, DHCP and DNS server on a segregated homelab subnet.

Forward lookups for the network are functioning perfeclty, but I’ve been unable to get PTR records to resolve. I’m clearly not understanding the expected syntax when creating a PTR record. I’ve tried several iterations, including:

10.0.0.15
10.0.0.15.in-addr.arpa
15.0.0.10
15.0.0.10.in-arpa

Regardless of what I do, the record never comes back when performing an nslookup/dig. I’ve tried specifying the FQDN, and just specifying the target hostname. No luck.

Plz halp, what am I getting wrong here?

vyos@router# show service dns forwarding authoritative-domain mylab.local
records {

ptr 5.0.0.10 {
target test.mylab.local
}
ptr 5.0.0.10.in-addr.arpa {
target test.mylab.local
}
ptr 10.0.0.5 {
target test.mylab.local
}
ptr 10.0.0.5.in-addr.arpa {
target test.mylab.local
}
}

In order to create a PTR record for the IPv4 10.0.0.15 the zone should look like this:

0.0.10.in-addr.arpa

And then in that zone you have an entry such as:

15 PTR host.example.com.

You could of course make larger zones like naming the zone as 10.in-addr.arpa and then use entries like:

15.0.0 PTR host.example.com.

So the things to keep in mind is:

  1. The TLD is in-addr.arpa for IPv4 and ip6.arpa for IPv6.

  2. The IP will be written in reverse (so IPv4 A.B.C.D is in reverse for PTR records written as D.C.B.A.in-addr.arpa).

  3. The record type is PTR.

  4. And when typing the hostname you want this IP to resolve into dont forget that dot at the end.

So if you want your IP to reverse resolve into “host.example.com” when you type the PTR record in the zone it should be written as “PTR host.example.com.”

1 Like

Thank you for the detailed explanation. I am embarrassed that I had forgotten how PTR also needs to be treated as a DNS domain/zone :face_with_open_eyes_and_hand_over_mouth: