diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php
index 98730e1a4..14c0eec32 100644
--- a/app/Livewire/Settings/Index.php
+++ b/app/Livewire/Settings/Index.php
@@ -119,13 +119,14 @@ public function submit()
return;
}
- $this->validate();
- // Trim FQDN to remove leading/trailing whitespace
+ // Trim FQDN to remove leading/trailing whitespace before validation
if ($this->fqdn) {
$this->fqdn = trim($this->fqdn);
}
+ $this->validate();
+
if ($this->settings->is_dns_validation_enabled && $this->fqdn) {
if (! validateDNSEntry($this->fqdn, $this->server)) {
$this->dispatch('error', "Validating DNS failed.
Make sure you have added the DNS records correctly.
{$this->fqdn}->{$this->server->ip}
Check this documentation for further help.");