[Bug]: Cant add IDN hostname to federation
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Impossible to add server with non-ascii name to federation.
Steps to reproduce
- find nextcloud server with non-ascii hostname
- try to add it as trusted server
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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