Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6125969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:18:45+00:00 2026-05-23T16:18:45+00:00

I need to convert a ipv6 address to its nibble format for use in

  • 0

I need to convert a ipv6 address to its nibble format for use in creating ptr records dynamically. Here is the information I got from Wikipedia:

IPv6 reverse resolution

Reverse DNS lookups for IPv6 addresses
use the special domain ip6.arpa. An
IPv6 address appears as a name in this
domain as a sequence of nibbles in
reverse order, represented as
hexadecimal digits as subdomains. For
example, the pointer domain name
corresponding to the IPv6 address
2001:db8::567:89ab is
b.a.9.8.7.6.5.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.

The only thing I could find regarding nibbles was in the pack function, http://www.php.net/pack. I could not find any solutions with examples from googling the issue.

Any help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:18:46+00:00Added an answer on May 23, 2026 at 4:18 pm

    Given a suitably modern version of PHP (>= 5.1.0, or 5.3+ on Windows), use the inet_pton function to parse the IPv6 address into a 16 byte array, and then use standard string ops to reverse it.

    $ip = '2001:db8::567:89ab';
    $addr = inet_pton($ip);
    $unpack = unpack('H*hex', $addr);
    $hex = $unpack['hex'];
    $arpa = implode('.', array_reverse(str_split($hex))) . '.ip6.arpa';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need to convert a string to normal datetime format so it can be correctly
I need to convert a shapefile/ kml to encoded polyline format for a certain
I need to convert a 3-channel image to 1-channel in order to use Hough
I need to convert a date in format eg. 2011-01-02 to a unix timestamp
Need to convert byte arrays of images and videos back to its origin. I
I need to convert HTML file to iXBRL format. iXBRL format is basically html
I need to convert image from one format, some big format, to some lite
I need to convert the following format into a new format using NSDateFormatter. 'Fri,
I need to convert latitude/longitude coordinates into Easting/Northing coordinates in the Alberta 10 TM
I need to convert a named instance of SQL server 2005, to a default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.