Re: AW: ipv6 PTR in zone file

2011-04-17 Thread Joseph S D Yao
On Tue, Apr 12, 2011 at 11:21:14AM +0200, Marco Davids (SIDN) wrote:
...
 Or do it 'the BIND way':
 
  dig  -x 2001:7b8:c05::80:1 | grep ip6.arpa | tail -1 | awk '{print $1}'
...

If things work right, this seems to give the name of the smallest
existing enclosing zone (from the SOA or NS record), not the entry in
the zone.  Wasn't the latter what was desired?  And what if you are
creating the new zone?

As 'arpaname' given the above, returns:

1.0.0.0.0.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.C.0.8.B.7.0.1.0.0.2.IP6.ARPA

then the entry

1.0.0.0.0.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR sidn.bip.bit.nl.

in the 5.0.c.0.8.b.7.0.1.0.0.2.ip6.arpa. zone file
(zone.2001:07b8:0c05?) may be the best we can do in general.

In specific, we could enter:

$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0
1.0.0.0.0.8.0.0 PTR sidn.bip.bit.nl.
...
$ORIGIN 5.0.c.0.8.b.7.0.1.0.0.2.ip6.arpa.
if we have multiple addresses in that subnet.

But M. de Nostredame already is aware of how to do this.

Using one of the existing IPAM (IP Address Management) appliances might
be what you need.  BT has one that looked good.


--
/*\
**
** Joe Yao  j...@tux.org - Joseph S. D. Yao
**
\*/
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: AW: ipv6 PTR in zone file

2011-04-15 Thread John Wobus

pint use Net::IP
pint $foo = new Net::IP '2001:db8::42'
3
pint $foo-reverse_ip()
2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d. 
0.1.0.0.2.ip6.arpa.

pint


Or you could just dash off the simple perl expression to do the job:

my $ptr = do {
my($head,$tail) =
  map { join '', map { sprintf '%04s',$_; } split /:/,$_; }
  split /::/, $addr  . '::', 3;
my $hex32 = '0' x 32;
substr( $hex32, 0, length($head) ) = $head;
substr( $hex32, 32, -length($tail) ) =  $tail;
join '.', ( reverse split //, $hex32 ), 'ip6.arpa';
};


John
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: AW: ipv6 PTR in zone file

2011-04-15 Thread Shumon Huque
On Fri, Apr 15, 2011 at 10:56:00AM -0400, John Wobus wrote:
 pint use Net::IP
 pint $foo = new Net::IP '2001:db8::42'
 3
 pint $foo-reverse_ip()
 2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d. 
 0.1.0.0.2.ip6.arpa.
 pint
 
 Or you could just dash off the simple perl expression to do the job:
 
 my $ptr = do {
 my($head,$tail) =
   map { join '', map { sprintf '%04s',$_; } split /:/,$_; }
   split /::/, $addr  . '::', 3;
 my $hex32 = '0' x 32;
 substr( $hex32, 0, length($head) ) = $head;
 substr( $hex32, 32, -length($tail) ) =  $tail;
 join '.', ( reverse split //, $hex32 ), 'ip6.arpa';
 };
 

In case Pythonistas feel neglected, here's my contribution:

- Cut here --

#!/usr/bin/env python
#

import sys, socket

def ip6toptr(address):
return PTR owner name of an IPv6 address
try:
packed = socket.inet_pton(socket.AF_INET6, address)
except socket.error:
raise ValueError(%s isn't an IPv6 address % address)   
hexstring = ''.join([%02x % ord(x) for x in packed])
ptrowner = %s.ip6.arpa % \
   '.'.join([x for x in hexstring[::-1]])
return ptrowner

if __name__ == '__main__':
print ip6toptr(sys.argv[1])

- Cut here --

-- 
Shumon Huque
University of Pennsylvania.
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: AW: ipv6 PTR in zone file

2011-04-13 Thread Michel de Nostredame
On Tue, Apr 12, 2011 at 3:41 AM, Niall O'Reilly niall.orei...@ucd.ie wrote:
 On 12 Apr 2011, at 10:49, Michel de Nostredame wrote:
 Thanks Walter and Marco. Those two tool/method do resolve short term
 needs. Thanks again.
 (btw, the URL form Walter should be
 ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/ )

 Beside them, is any potential possibility to have something build-in
 in BIND config/zone file as kind of beautiful (my, and my team,
 personal point of view) solution?

 Anyone knows if there was any similar discussions inside BIND
 developer group before?

        Not that I recall.

        I'm not sure what benefit you see in adding a feature to
        the BIND server and tools.  I should have thought that a
        suitable script, either for provisioning your zone file(s)
        or for applying a dynamic update, would both relieve any
        burden you currently have, and leave you more flexibility
        than would an extension to BIND.

If there is $REVERSE (or some similar directive) can put inside ZONE
file and named.conf file, then it would be a good help for those
people who need to manually manage PTR records. From regular people
point of view, it could be easier to read, maintain and less possible
of human errors.

Not sure how large will be the effort to add a new directive into
BIND, but that just a feed back, and wish, from me and my team
members, who needs to maintain few hundreds of statically assigned IPs
for servers and CE/PE routers.

--
Michel~
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: AW: ipv6 PTR in zone file

2011-04-13 Thread Bill Larson

On Apr 13, 2011, at 4:58 PM, Michel de Nostredame wrote:

On Tue, Apr 12, 2011 at 3:41 AM, Niall O'Reilly  
niall.orei...@ucd.ie wrote:

On 12 Apr 2011, at 10:49, Michel de Nostredame wrote:

Thanks Walter and Marco. Those two tool/method do resolve short term
needs. Thanks again.
(btw, the URL form Walter should be
ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/ )

Beside them, is any potential possibility to have something build-in
in BIND config/zone file as kind of beautiful (my, and my team,
personal point of view) solution?

Anyone knows if there was any similar discussions inside BIND
developer group before?


   Not that I recall.

   I'm not sure what benefit you see in adding a feature to
   the BIND server and tools.  I should have thought that a
   suitable script, either for provisioning your zone file(s)
   or for applying a dynamic update, would both relieve any
   burden you currently have, and leave you more flexibility
   than would an extension to BIND.


If there is $REVERSE (or some similar directive) can put inside ZONE
file and named.conf file, then it would be a good help for those
people who need to manually manage PTR records. From regular people
point of view, it could be easier to read, maintain and less possible
of human errors.

Not sure how large will be the effort to add a new directive into
BIND, but that just a feed back, and wish, from me and my team
members, who needs to maintain few hundreds of statically assigned IPs
for servers and CE/PE routers.


Back in the good old days, when DNS administrators didn't have fancy  
tools, there was a common solution to this problem.


I wrote a little script which took a host name and an IP address  
(IPv4, but the idea would be the same for IPv6) and generated the  
forward DNS A record for this and append it, or insert it, into the  
forward zone file.  Then, this same script would then take this same  
information and add the appropriate PTR into the appropriate reverse  
zone file.  The h2n script was another tool commonly used to manage  
DNS information from the contents of the /etc/hosts file.


The problem with introducing some new directive into BIND is that your  
idea of what would be the appropriate zones files to work with may not  
be the same as someone else.  For example, in the forward zone, would  
assigning MX records be the correct result also?  There are too many  
possibilities to allow solving everyone's needs.  This is something  
that needs to be done by the DNS administrator who understands the  
needs of the zone.  (At least in my very humble opinion).


Bill Larson
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: AW: ipv6 PTR in zone file

2011-04-13 Thread Alan Clegg
On 4/13/2011 6:58 PM, Michel de Nostredame wrote:

 Not sure how large will be the effort to add a new directive into
 BIND, but that just a feed back, and wish, from me and my team
 members, who needs to maintain few hundreds of statically assigned IPs
 for servers and CE/PE routers.

Dynamic zones and the judicious use of arpaname seems like the best
bet to me (without adding extra code to BIND, that is).

AlanC



signature.asc
Description: OpenPGP digital signature
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

AW: ipv6 PTR in zone file

2011-04-12 Thread Walter.Jontofsohn

Hello,

you could use ipv6calc (ftp://ftp.bieringer.de/pub/linux/ipv6/ipv6calc) to 
calculate the reverse strings.
Then you can put them into the zone file.

With Best regards,

Walter


Im Auftrag von Michel de Nostredame
Gesendet: Montag, 11. April 2011 20:44
An: bind-users
Betreff: ipv6 PTR in zone file

Hi BIND Users,

I am not sure if my post here is proper or not. If not please 
kindly guide me to a correct list.

I have lot of static IPv6 address needs to add into DNS PTR record.
Most of them are server IP addresses and addresses on router 
interfaces.
Compose proper PTR records, without human errors, is highly 
difficult (compares to IPv4 PTR records), as we encode some 
customer information into the address.

I tried to look into bit-string and soon realized it is 
already removed from recent BIND versions. Then tried to 
search $REVERSE and $INVERSE on Google but got no much 
luck; seems not much development / discussion recently.

For example, today we probably do PTR list this,

$ORIGIN 0.0.0.0.0.0.d.4.1.a.1.0.1.0.0.2.ip6.arpa.
1.0.1.a.0.0.0.5.6.0.c.1.0.0.5.6 PTR
xe-3-0-3-101.ar.par1.fr.netname.net.


What I am think about is if there is any potential possibility 
to compose IPv6 PTR records in ZONE files in a little easier method?
something like

$ORIGIN $REVERSE(2001:01a1:4d00:).ip6.arpa.
$REVERSE(6500:1c06:5000:a101)  PTR
xe-3-0-3-101.ar.par1.fr.netname.net.

___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: AW: ipv6 PTR in zone file

2011-04-12 Thread Marco Davids (SIDN)
On 04/12/11 10:50, walter.jontofs...@t-systems.com wrote:

 you could use ipv6calc (ftp://ftp.bieringer.de/pub/linux/ipv6/ipv6calc) to 
 calculate the reverse strings.

Yes.

Or do it 'the BIND way':

 dig  -x 2001:7b8:c05::80:1 | grep ip6.arpa | tail -1 | awk '{print $1}'

--
Marco

 Im Auftrag von Michel de Nostredame
 Gesendet: Montag, 11. April 2011 20:44
 An: bind-users
 Betreff: ipv6 PTR in zone file

 Hi BIND Users,

 I am not sure if my post here is proper or not. If not please 
 kindly guide me to a correct list.

 I have lot of static IPv6 address needs to add into DNS PTR record.
 Most of them are server IP addresses and addresses on router 
 interfaces.
 Compose proper PTR records, without human errors, is highly 
 difficult (compares to IPv4 PTR records), as we encode some 
 customer information into the address.

 I tried to look into bit-string and soon realized it is 
 already removed from recent BIND versions. Then tried to 
 search $REVERSE and $INVERSE on Google but got no much 
 luck; seems not much development / discussion recently.

 For example, today we probably do PTR list this,

 $ORIGIN 0.0.0.0.0.0.d.4.1.a.1.0.1.0.0.2.ip6.arpa.
 1.0.1.a.0.0.0.5.6.0.c.1.0.0.5.6 PTR
 xe-3-0-3-101.ar.par1.fr.netname.net.


 What I am think about is if there is any potential possibility 
 to compose IPv6 PTR records in ZONE files in a little easier method?
 something like

 $ORIGIN $REVERSE(2001:01a1:4d00:).ip6.arpa.
 $REVERSE(6500:1c06:5000:a101)  PTR
 xe-3-0-3-101.ar.par1.fr.netname.net.
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: AW: ipv6 PTR in zone file

2011-04-12 Thread Michel de Nostredame
On Tue, Apr 12, 2011 at 2:21 AM, Marco Davids (SIDN)
marco.dav...@sidn.nl wrote:
 On 04/12/11 10:50, walter.jontofs...@t-systems.com wrote:
 you could use ipv6calc (ftp://ftp.bieringer.de/pub/linux/ipv6/ipv6calc) to 
 calculate the reverse strings.
 Yes.
 Or do it 'the BIND way':
  dig  -x 2001:7b8:c05::80:1 | grep ip6.arpa | tail -1 | awk '{print $1}'

Thanks Walter and Marco. Those two tool/method do resolve short term
needs. Thanks again.
(btw, the URL form Walter should be
ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/ )

Beside them, is any potential possibility to have something build-in
in BIND config/zone file as kind of beautiful (my, and my team,
personal point of view) solution?

Anyone knows if there was any similar discussions inside BIND
developer group before?

--
Michel~
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Re: AW: ipv6 PTR in zone file

2011-04-12 Thread Marco Davids (SIDN)
On 04/12/11 11:49, Michel de Nostredame wrote:

 you could use ipv6calc (ftp://ftp.bieringer.de/pub/linux/ipv6/ipv6calc) to 
 calculate the reverse strings.
 Yes.
 Or do it 'the BIND way':
  dig  -x 2001:7b8:c05::80:1 | grep ip6.arpa | tail -1 | awk '{print $1}'

 Beside them, is any potential possibility to have something build-in
 in BIND config/zone file as kind of beautiful (my, and my team,
 personal point of view) solution?

I wonder if the $GENERATE directive could work for you.

Not sure...

http://www.zytrax.com/books/dns/ch8/generate.html

--
Marco
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: AW: ipv6 PTR in zone file

2011-04-12 Thread Niall O'Reilly

On 12 Apr 2011, at 10:49, Michel de Nostredame wrote:

 Thanks Walter and Marco. Those two tool/method do resolve short term
 needs. Thanks again.
 (btw, the URL form Walter should be
 ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/ )
 
 Beside them, is any potential possibility to have something build-in
 in BIND config/zone file as kind of beautiful (my, and my team,
 personal point of view) solution?
 
 Anyone knows if there was any similar discussions inside BIND
 developer group before?

Not that I recall.

I'm not sure what benefit you see in adding a feature to
the BIND server and tools.  I should have thought that a
suitable script, either for provisioning your zone file(s)
or for applying a dynamic update, would both relieve any
burden you currently have, and leave you more flexibility
than would an extension to BIND.

FWIW, here's yet another way, grabbed from a shell (bash)
session.

dhcp-c101a88b(niall)4: alias pint
alias pint='perl -ne '\''sub BEGIN {print pint } sub END {print \n} printf 
%s\npint ,eval'\'''
dhcp-c101a88b(niall)5: pint
pint use Net::IP

pint $foo = new Net::IP '2001:db8::42'
3
pint $foo-reverse_ip()
2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
pint ^D
dhcp-c101a88b(niall)6: 

Best regards,
Niall O'Reilly

___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: AW: ipv6 PTR in zone file

2011-04-12 Thread Chris Thompson

On Apr 12 2011, Marco Davids (SIDN) wrote:


On 04/12/11 10:50, walter.jontofs...@t-systems.com wrote:


you could use ipv6calc (ftp://ftp.bieringer.de/pub/linux/ipv6/ipv6calc) to 
calculate the reverse strings.


Yes.

Or do it 'the BIND way':

dig  -x 2001:7b8:c05::80:1 | grep ip6.arpa | tail -1 | awk '{print $1}'


Oh, yuck. There is a perfectly good program shipped with BIND to do this:

$ type arpaname
arpaname is /usr/local/sbin/arpaname

$ arpaname 2001:7b8:c05::80:1
1.0.0.0.0.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.C.0.8.B.7.0.1.0.0.2.IP6.ARPA

--
Chris Thompson
Email: c...@cam.ac.uk
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users