diff --git a/.changelog/22779.txt b/.changelog/22779.txt
new file mode 100644
index 000000000000..74f7e6a1257d
--- /dev/null
+++ b/.changelog/22779.txt
@@ -0,0 +1,3 @@
+```release-note:bug
+ui: Allow FQDN to be displayed in the Consul web interface.
+```
diff --git a/ui/packages/consul-ui/app/utils/process-ip-address.js b/ui/packages/consul-ui/app/utils/process-ip-address.js
index 9e7bffa04d12..445d2c6ca54c 100644
--- a/ui/packages/consul-ui/app/utils/process-ip-address.js
+++ b/ui/packages/consul-ui/app/utils/process-ip-address.js
@@ -11,6 +11,10 @@ export function processIpAddress(ip) {
// Basic IPv6 pattern (loose, just enough to pass to URL)
const ipv6Pattern = /^[0-9a-fA-F:]+$/;
+ // FQDN validation (RFC 1035, basic)
+ const fqdnPattern =
+ /^(?=.{1,253}$)(?!-)[A-Za-z0-9-]{1,63}(?{{format-ipaddr this.inputValue}}`);
+ assert.dom(this.element).hasText('example.com');
+
+ this.set('inputValue', 'sub.domain.example.com');
+ await render(hbs`
{{format-ipaddr this.inputValue}}
`);
+ assert.dom(this.element).hasText('sub.domain.example.com');
+
+ this.set('inputValue', 'my-service.local');
+ await render(hbs`{{format-ipaddr this.inputValue}}
`);
+ assert.dom(this.element).hasText('my-service.local');
+ });
});
diff --git a/ui/packages/consul-ui/tests/unit/utils/process-ip-address-test.js b/ui/packages/consul-ui/tests/unit/utils/process-ip-address-test.js
index 5ebf5b2642c0..dae89720b266 100644
--- a/ui/packages/consul-ui/tests/unit/utils/process-ip-address-test.js
+++ b/ui/packages/consul-ui/tests/unit/utils/process-ip-address-test.js
@@ -42,4 +42,13 @@ module('Unit | Utility | Process Ip Address', function () {
assert.equal(processIpAddress('fe80::202:b3ff:fe1e:8329'), '[fe80::202:b3ff:fe1e:8329]');
});
+
+ test('Returns as it is for valid FQDNs', function (assert) {
+ assert.equal(processIpAddress('example.com'), 'example.com');
+ assert.equal(processIpAddress('sub.domain.example.com'), 'sub.domain.example.com');
+ assert.equal(processIpAddress('a-b-c.domain.co.uk'), 'a-b-c.domain.co.uk');
+ assert.equal(processIpAddress('xn--d1acufc.xn--p1ai'), 'xn--d1acufc.xn--p1ai'); // punycode
+ assert.equal(processIpAddress('localhost'), 'localhost');
+ assert.equal(processIpAddress('my-service.local'), 'my-service.local');
+ });
});