Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Absolute DNS name are supported

Open
#229 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
networking

Research direction

Start at the UdpTransportExecutor entry point and reproduce the provided PHP example with a trailing-dot name such as www.google.com.. Trace how the Query name is handled before the UDP request is sent, then verify that A and AAAA queries resolve successfully for absolute DNS names.

Written by the indexing model from the issue text.

Description

bug

The UdpTransportExecutor does not correctly handle FQDN with a trailing dot, such as google.com.. This notation is often used for in-cluster DNS queries and ensures efficiency by telling the resolver not to search using local domain suffixes. When passing such names, the resolution fails.

use React\Dns\Model\Message;
use React\Dns\Query\Query;
use React\Dns\Query\UdpTransportExecutor;

$executor = new UdpTransportExecutor('8.8.8.8:53');

$name = $argv[1] ?? 'www.google.com.';

$ipv4Query = new Query($name, Message::TYPE_A, Message::CLASS_IN);
$ipv6Query = new Query($name, Message::TYPE_AAAA, Message::CLASS_IN);

$executor->query($ipv4Query)->then(function (Message $message) {
    foreach ($message->answers as $answer) {
        echo 'IPv4: ' . $answer->data . PHP_EOL;
    }
}, 'printf');
$executor->query($ipv6Query)->then(function (Message $message) {
    foreach ($message->answers as $answer) {
        echo 'IPv6: ' . $answer->data . PHP_EOL;
    }
}, 'printf');

I tested on php8.4, react/socket v1.16.0, react/dns v1.13.0

Dominant language
PHP
Stars
542
Forks
62
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reactphp/dns

All issues in reactphp/dns

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.