PaperMC / PaperMC/Velocity

Unresolved `InetAddress` if using hostname in `[servers]` section of configuration

Open
#1,750 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
Java
Stars
2.3k
Forks
959
Avg merge
5d 10h
Merged PRs (30d)
2

Description

Expected Behavior

It should resolve hostnames (e.g., localhost -> ::0) as the other program does.

Actual Behavior

It now has an unresolved InetAddress.

Steps to Reproduce
  1. Add exampleserver = 'some-hostname-that-should-resolve-by-dns:25565' in [servers] section of velocity.toml.
  2. Try to access the ServerInfo#getAddress() of exampleserver via any plugins in Velocity.
  3. We have an unresolved InetAddress.
Plugin List
Velocity Version

[15:55:57 INFO]: Velocity 3.5.0-SNAPSHOT (git-d11511c1-b584)
[15:55:57 INFO]: Copyright 2018-2026 Velocity Contributors。Velocity 以 GNU 通用公共许可证第三版授权。
[15:55:57 INFO]: PaperMC - GitHub

Additional Information

Ref: https://github.com/PaperMC/Velocity/blob/d11511c18499497e7f7186211b109ef395b44acd/proxy/src/main/java/com/velocitypowered/proxy/util/AddressUtil.java#L44-L58
Why didn't we always resolve the hostname?

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 with proxy/src/main/java/com/velocitypowered/proxy/util/AddressUtil.java at lines 44-58, then trace how the [servers] section creates the ServerInfo exposed by ServerInfo#getAddress(). Compare the current behavior with the expected hostname resolution for localhost and DNS names. Done means configured hostnames provide resolved InetAddress values to plugins.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.