Skip to content

[Bug]: Container icons fail to load on IPv6-only domain names #152

Description

@fraptrap

Version

2026.09.03

Unraid Version

7.3.0

Bug Description

compose_icon_is_safe_host() uses gethostbyname() to resolve the domain name, but this function only supports IPv4 in PHP. When the domain of the icon URL has only an AAAA record (IPv6-only), gethostbyname returns the original domain name, causing the function to incorrectly judge it as unresolvable and refuse to load the icon. It is suggested to use dns_get_record($host, DNS_A | DNS_AAAA) to query both A and AAAA records, or to also perform public/private network checks for IPv6 addresses.

Reproduction: php -r 'var_dump(gethostbyname("IPv6-only domain"));' returns the domain name itself.

Expected Behavior

I expected the container icon specified by net.unraid.docker.icon to be fetched and displayed normally on the Compose page, just as it did before updating to plugin version 2026.09.03.

The icon URL is reachable from the Unraid host and returns HTTP 200 with Content-Type: image/png, so the Compose page should show the actual icon instead of the fallback question mark placeholder.

Steps to Reproduce

  1. Use an icon URL whose hostname resolves only to IPv6 (AAAA), with no IPv4 (A) record.
  2. Set it as a container label: net.unraid.docker.icon=https://<ipv6-only-domain>/icon.png.
  3. Open the Compose page.
  4. The icon shows the fallback question mark placeholder instead of the real image.
  5. Confirm php -r 'var_dump(gethostbyname("<ipv6-only-domain>"));' returns the hostname itself.

Relevant Logs

Compose

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions