This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Ipv6 resolver script

Old posts that have not been replied to for several years.
Locked
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Ipv6 resolver script

Post by Xpert »

Anyone has scripts that doing that:
(Xpert) !ipv6 2001:618:400:bf69::63
(eggush) 2001:0618:0400:BF69:0000:0000:0000:0063 PTR RECORD 3.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.6.f.b.0.0.4.0.8.1.6.0.1.0.0.2.ip6.arpa
Thanks :)
Xpert.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

From my ipv6dns.tcl (@ www.tclscript.com ), here is a proc to change to nibble format... It was done a long time ago, so some optimizations could probably be made, but it works fine..

Code: Select all

proc ipv6tonibble {ip {type "int"}} {
  set newip ""
  set nlist ""
  set mlist [split $ip ":"]
  foreach element $mlist {
    if {[string trim $element] == ""} {
      set totzeros [expr 8 - [llength $mlist]]
      for {set i 0} {$i <= $totzeros} {incr i} {
        lappend nlist 0
      }
    } else {
      lappend nlist $element
    }
  }
  for {set i [expr [llength $nlist] - 1]} {$i >= 0} {incr i -1} {
    set seg [lindex $nlist $i]
    for {set j 0} {$j < 4} {incr j} {
      if {$seg != ""} {
        append newip "[string index $seg [expr [string length $seg] - 1]]."
        if {[string length $seg] > 1} {
          set seg [string range $seg 0 [expr [string length $seg] - 2]]
        } else {
          set seg ""
        }
      } else {
        append newip "0."
      }
    }
  }
  append newip "ip6.$type"
  return $newip
}
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Thanks, you helped me a lot :P
Xpert.
Locked