Skip to content

Always resolve hostnames. (Fix #1750)#1751

Open
qyl27 wants to merge 2 commits intoPaperMC:dev/3.0.0from
qyl27:always-resolve-hostnames
Open

Always resolve hostnames. (Fix #1750)#1751
qyl27 wants to merge 2 commits intoPaperMC:dev/3.0.0from
qyl27:always-resolve-hostnames

Conversation

@qyl27
Copy link
Copy Markdown

@qyl27 qyl27 commented Mar 23, 2026

This PR fixes #1750. It will resolve all the hostnames in the configuration.

We're resolving in bind before, and [servers] are not.

Signed-off-by: 秋雨落 <i@rain.cx>
Copilot AI review requested due to automatic review settings March 23, 2026 08:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses #1750 by ensuring server addresses defined via configuration/CLI are parsed using a resolving address parser so ServerInfo#getAddress() no longer returns an unresolved InetAddress when hostnames are used.

Changes:

  • Removed the non-resolving AddressUtil.parseAddress and switched call sites to AddressUtil.parseAndResolveAddress.
  • Updated config validation and server registration paths to use the resolving parser for both bind and [servers] entries.
  • Updated CLI --add-server parsing to use the resolving parser.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
proxy/src/main/java/com/velocitypowered/proxy/util/AddressUtil.java Removes parseAddress, leaving parseAndResolveAddress as the primary parser (and dropping Guava IP parsing).
proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java Validates bind and [servers] addresses using the resolving parser.
proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java Registers config servers using the resolving parser during start/reload.
proxy/src/main/java/com/velocitypowered/proxy/ProxyOptions.java Parses --add-server values using the resolving parser.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: 秋雨落 <i@rain.cx>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants