Reverse DDNS on classless zones
Simon Hobson
dhcp1 at thehobsons.co.uk
Wed Jul 18 07:10:12 UTC 2012
atif yameen wrote:
>and the following is my reverse zone in named.conf
>
>zone "128-25.25.119.129.in-addr.arpa"
>{
> type master;
> file "4981050.65ED25AA06C49D877204B11DDCB30C43.db";
> allow-transfer { x.x.x.x; };
> allow-update { <IP-Address-of-DHCP-Server; };
> also-notify { x.x.x.x; };
>};
>
>when a client in the said network obtains an ip address, the dhcp
>server registers its reverse name as follows :
>
>Jul 17 20:25:37 new dhcpd: Added reverse map from
>250.25.119.129.128-25.25.119.129.in-addr.arpa to a.b.com
>where as it should be : 250.128-25.25.119.129.in-addr.arpa
>
>zone file shows the following: (creates a subzone 129 and then a
>dotted name from the rest of the three octets)
>
>$ORIGIN 129.128-25.25.119.129.in-addr.arpa.
>$TTL 302400 ; 3 days 12 hours
>250.25.119 PTR a.b.com.
>
>Any Ideas why this is happening?
Yes. The DNS system does not support splitting of zones on anything
but "dots" - and in particular it does not support what you are
trying to do directly. "128-25" does not mean anything at all to it -
it's just a string of characters.
When registering an entry, all that happens is the four octets are
reversed, prepended to the base zone name (default "in-addr.arpa"),
and the result is used.
So what you are seeing is correct behaviour, but there's a step
missing. To make lookups work, you need 128 CNAME entries in the real
25.119.129.in-addr.arpa zone of the form :
128 CNAME 128.25.119.129.128-25.25.119.129.in-addr.arpa.
129 CNAME 129.25.119.129.128-25.25.119.129.in-addr.arpa.
In BIND you can use the GENERATE statement to create these in one line.
You may also realise that suddenly you don't need to use
128-25.25.119.129.in-addr.arpa as the zone, it can literally be any
reachable zone. So you could use reverse.b.com, and then you'd have :
In 25.119.129.in-addr.arpa
128 CNAME 128.25.119.129.reverse.b.com.
...
And your client above would get an entry in the 25.119.129.reverse.b.com. zone
250 PTR a.b.com
Yes, classless DNS is a right pain !
FYI, in IPv6 the addresses use hex, and zones are split on 4 bit
boundaries. Combine the larger assignments with this and there should
never be any need for this sort of fudge.
--
Simon Hobson
Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.
More information about the dhcp-users
mailing list