Absolute DNS name are supported

Aperta
#229 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
php
Ambito
networking

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
PHP
Stelle
542
Fork
62
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di reactphp/dns

Tutte le issue di reactphp/dns

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.