nextcloud / nextcloud/server

[Bug]: Cant add IDN hostname to federation

Open
#53,185 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 31-feedback bug feature: federation feature: language/translations (l10n/i18n)
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

Impossible to add server with non-ascii name to federation.

Steps to reproduce
  1. find nextcloud server with non-ascii hostname
  2. try to add it as trusted server
  3. got error and No DNS record found for in logs
Expected behavior

Server successfully added to trusted list

Nextcloud Server version

31

Operating system

Other

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

Changing (partially reverting a907b74c2ac40a6d12976056cbc21eab09312936 )
in file
lib/private/Http/Client/DnsPinMiddleware.php

in function addDnsPinning
$targetIps = $this->dnsResolve(idn_to_utf8($hostName), 0)
to
$targetIps = $this->dnsResolve($hostName, 0)

allows to connect add server by entering "punycoded" (ascii) name.

Very brief test revealed no problems after this change.

Contributor guide

Open the contributing guide

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.

Research direction

Start in lib/private/Http/Client/DnsPinMiddleware.php at addDnsPinning, then reproduce federation setup with a non-ASCII hostname and compare it with its punycode form. Confirm the DNS lookup and trusted-server addition succeed for the IDN without a “No DNS record found” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
distributed-systems, networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.