#2208·Ocelot

Consul `Node.Name` might be a DNS name

Author: ggnaegiCreated Nov 20, 2024Updated Mar 23, 2026
LabelsbugService DiscoveryConsul

Expected Behavior / New Feature

The consul service discovery provider should check if the node.Name could be a DNS/Host Name, otherwise return the service url.

Actual Behavior / Motivation for New Feature

The consul service provider doesn't check if the node.Name is a host name. Depending on service discovery configuration, the node.Name might not be a host name.

https://developer.hashicorp.com/consul/docs/agent

Node name: This is a unique name for the agent. By default, this is the hostname of the machine, but you may customize it using the -node flag.

Steps to Reproduce the Problem

  1. Change the agent name, use something that is not related to the hostname.
  2. Try to use the Consul Service Discovery

Related to #2203 #954

  • #2203
  • #954