php-src icon indicating copy to clipboard operation
php-src copied to clipboard

internal functions with ipv6 support

Open mokraemer opened this issue 2 weeks ago • 3 comments

Description

php has some built in functions e.g. gethostbyname which only allow to get the ipv4 address. There is no function / option to get the ipv6 address, or maybe both at a time.

The web is (slowly) moving towards ipv6, so php should support ipv6 addresses as well and have functions returning them.

mokraemer avatar Nov 13 '26 16:11 mokraemer

https://www.php.net/manual/en/function.dns-get-record.php

adesysmarc avatar Nov 19 '26 08:11 adesysmarc

@adesysmarc: thanks for that hint, but this is quite "bare". You need to implement/know how to e.g. handle CNAME etc. You don't just get (all) resulting IP-adresses.

mokraemer avatar Nov 19 '26 08:11 mokraemer

found the solution: dns_get_record('HOSTNAME', DNS_A|DNS_AAAA) Maybe a hint in the docu of gethostbyname should be added...

mokraemer avatar Nov 19 '26 09:11 mokraemer