Server Name issues


In the apache sites-available config file the servername is correctly defined but when I restart apache I still get this error message:

Starting web server: apache2AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using Set the ‘ServerName’ directive globally to suppress this message

Am I missing something? How do I set it globally?

The ServerName for the apache2 got nothing directly to do with the FQDN of the host server itself (not on the first look).
You should set a valid FQDN for the host server before you start using it. It solves a lot of issues.
You can do that via virtualmin / webmin too. Go to webmin -> network -> network configuration -> DNS client and then set the FQDN at the hostname.
Make sure that the FQDN / hostname isnt used as a vhost name, that might cause issues.

It was already set to the FDQN but the DNS server reference was wrong (OVH again!) and the host addresses were also once again set to the OVH server name (I have changed this at least once before so do not know how it gets changed back). All now set to which unfortunately is (If I understand it right) one of my vhost names.

If this is going to give problems I am happy to change the main server name to xorex (in lieu of but in how many places do I need to make that change? And it will not affect my ssl certificates etc? Yes, they will be vhost based not server based so I can answer the one myself!

Came back this morning to find that the site had once more reset the DNS servers to the OVH servers and not my own. Is there another hidden (template) file I need amend to get this change to stick? The hostname has not changed.

Im having trouble following what your saying mate.
so for example …
if I have a FQDN “gelshoes” (& its a registered domain name) & I use it for the server hostname then I should not also use it as the virtual host name (website name) as well as it could cause conflicts.
So in effect Im using a registered domain name solely as the server host name & nothing else.
If thats teh case Id be better off just registering some useless domain name to use as the server hostname as I would be wanting to use “gelshoes” as a website (virtual host).
Is that correct?
Thanks in advance for your advice.
Sorry I am a newbie … learning very slowly about “server do’s n dont’s”

Nobody is suggesting that.

Our documentation in many places recommends using a name like or or whatever. You don’t need to register any additional domain names. It’s just a name. The name doesn’t matter, but if you make it the same as one hosting mail and websites, you are adding complexity to your configuration that most people just aren’t equipped to deal with.

Don’t make it complicated. Just give it a name and add it to your DNS zone once you create the second level domain for it (e.g. I might name my server and then later create a domain in Virtualmin…then I can add the n1 name to the zone in the BIND DNS module).


I am also a newbie and also very confused! At least the changes I made to the DNS server settings have got rid of the apache2 error message this post started with.

I have found that hostname appears to be used fluidly for both the server name and the FQDN in many articles I have read (probably because it is not fully understood by the author or the author assumes the reader fully understands it).

I think you will find that gelshoes is not your FQDN. The FQDN would be gelshoes.domain.tld or gelshoes.tld. Like you, I find this all really confusing.

My equivalent of gelshoes.domain.tld is, my FQDN. It looks like I have set the server up incorrectly as I have used the FQDN as my hostname and according to Carson, this will give me problems down the line for my virtual host that I have set up. What sort of problems am I going to encounter?

So my entries are:


and /etc/hosts includes these lines localhost

I needed to reboot the server to reset it with these changes and make them permanent.

What I do not understand is now when I ssh in to the server I see that my response is root@xorex:~# and not which is what I would have expected. Can someone explain why?

How do I amend my setup to avoid the problems that Carson suggests?

Should I call my server just xorex then set:



and /etc/hosts to still include these lines localhost

or should it be xorex localhost


Finally Joe, it is also not clear to me in your response why I would want to add the n1 name to the dns zone (as n1 or as if I am not using the n1 for anything other than the name of the server?

I know I am an idiot so please treat me as one in your responses!

I don’t care, and Virtualmin, and the internet, and all the services on your server, do not care what you call it. But, if you call your server the same name,, as a domain being hosted by Apache, Postfix, etc. you are adding a lot of extra confusing configuration to your life. There is literally no reason to do that to yourself.

Add whatever word you want in front of, nobody cares! But, add something. Don’t make it complicated. I historically used srv1, srv2, srv3, etc. when I had a simple setup…more recently, when we added bunch of additional virtual machine and cloud resources, I switched to a subdomain ( and put all my server names into that subdomain.

The name of the server is the name of the server. It is not related to any of your domains hosted within. You don’t have to name it, if you have some other DNS zone you want to put the name in, that’s fine. If your hosting provider gave it a FQDN that resolves (some do), that’s also fine. Nobody cares. It needs to be fully-qualified, and it needs to resolve for outside hosts (it needs to be in a DNS zone that has working servers) eventually. But, it does not matter at all what that name is.

1 Like

A domain name with isnt a FGDN.” is a FQDN as an example. “” is just the domain.

As @Joe already said, please do read about FQDN and domains in general.
Like I said in the upper part, the your domain “” isnt a FGQN, its just a domain.
Your setup just screams for confusion and DNS issues. You should correct that, it will help you a lot in the future (especially with mails).
Joe got a bit direct there, but he has a valid point. :slight_smile:

I am really sorry for my lack of experience but this is a really confusing issue.

I have followed Joe’s message and set the following by editing the hosts and hostname files in /etc and using hostname in the cli.

root@xorex:~# hostname
root@xorex:~# hostname -f

Will this now work for me if I set up a virtual host of or will it give me configuration problems?

Are there any other changes I need to make if this setup is OK? In the DNS zones? Which zone and what amendment?

Thanks for your patience.

Make sure to check if virtualmin actually accepted the changes:

If its listed there, make sure to re-check the configuration. It should correct necessary parts.
If not, set it there and do the re-check afterwards.
Its possible that it might be needed to reboot the machine.

In general you need to adjust the DNS settings to that, but that depends on your DNS solution.
You could check hosts, networking and resolv (files).

That’s not accurate.

Both are fully qualified domain names. But, we recommend using a name with an extra level to avoid confusing additional configuration later.

From what I learned and read about it, it is.
Purely the domain with a TLD isn’t a valid FQDN.

Your source is wrong or you’re misunderstanding it. If is a complete name that points to a resource (it is), it is a fully qualified domain name. If it did not point to a resource, but had some names under it (e.g. that did, then it would be a zone/domain but would not be a fully qualified domain name. But, it can be both.

This is hard to reason about, I guess, since there can be children of this name, but the name of this domain/zone itself has an A record and resolves to a specific, unique, host on the internet:		15626	IN	A

Notice the period (.) at the end? This designates it as the complete, fully qualified, domain name, rather than a relative name. A relative name, one without a . at the end, would not be fully qualified.

But, again, no reason to make this complicated. Just give the server a name. Any name. In any second-level domain you control. Doesn’t matter, as long as it’s not one you’ll be creating a Virtualmin domain for, and as long as you can make it resolve by adding it to an existing zone or a zone that Virtualmin will be managing later.

I see where you confusion comes from. There is a lot of wrong/misleading information on the web!

Your second level domain is delegated to your DNS server. You control everything within that domain ( for me), including the second level name itself. I gave it an A record (as many people do, pointing to the same IP as www), thus it is a fully qualified domain name. www, by itself, is not fully qualified. is, and so is in this case.

A server can absolutely be named with a second level domain (e.g., and it is fully qualified, but it probably shouldn’t be in a Virtualmin system (or any system that will have a virtual host with the same name and will be receiving mail via the virtual map file in Postfix, because it will lead to confusing configuration needs and special cases).

I am not really wrong about it, even though I know where you are going with it. :smiley:
A FGQN needs a third level to be a valid one, otherwise it (might) work but per definition its not a FQDN. :slight_smile:
And I do obviously know about the root level (.) behind it, its just that you dont need to specify that for general usage as browsing the web.
But again, I dont want to annoy someone or get into a fight. So please dont take it the wrong way.

Hi Joe,

If I understand you correctly I need to add a dns entry of to my zone pointing at the same IP. Is that right?

Not sure why it is needed but will do it if you confirm.


Another issue. I ran apache2 status and got this message;

Apr 19 12:30:40 apache2[3469]: Starting web server: apache2AH00557: apache2: apr_sockaddr_info_get() failed for
Apr 19 12:30:40 apache2[3469]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using Set the ‘ServerName’ dire…this message
Apr 19 12:30:41 apache2[3469]: .
Apr 19 12:30:41 systemd[1]: Started LSB: Apache2 web server.

Even running status -l does not write out the line in full so not sure where it is asking me to set the server name. Also do not know what the sockaddr error is for.

Have added in the dns zone. Checked network settings and the hostname was correct but the DNS Servers IP had once more changed to a single server I do not recognise (it is an OVH server [my host] but not one I have set. Checked OVH for my domain and the DNS servers are set as I want them and do not include the one with this IP). Changed network settings on my server again to the correct servers ( [] and a secondary server at OVH that has a different IP to the one shown in the network settings above). Restarted bind and once more the DNS Servers have changed! What do I have to edit to make the change persistent?

Finally I ran bind9 status and got these errors? Any ideas please?

service bind9 status
● bind9.service - BIND Domain Name Server

  • Loaded: loaded (/lib/systemd/system/bind9.service; enabled)*
  • Drop-In: /run/systemd/generator/bind9.service.d*
  •       └─50-insserv.conf-$named.conf*
  • Active: active (running) since Sun 2020-04-19 12:41:48 CEST; 12s ago*
  • Docs: man:named(8)*
  • Process: 6337 ExecStop=/usr/sbin/rndc stop (code=exited, status=0/SUCCESS)*
  • Main PID: 6361 (named)*
  • CGroup: /system.slice/bind9.service*
  •       └─6361 /usr/sbin/named -f -u bind*

Apr 19 12:41:48 named[6361]: error (network unreachable) resolving ‘./DNSKEY/IN’: 2001:500:2f::f#53
Apr 19 12:41:48 named[6361]: error (network unreachable) resolving ‘./DNSKEY/IN’: 2001:500:3::42#53
Apr 19 12:41:48 named[6361]: error (network unreachable) resolving ‘./DNSKEY/IN’: 2001:503:ba3e::2:30#53
Apr 19 12:41:48 named[6361]: error (network unreachable) resolving ‘./DNSKEY/IN’: 2001:7fe::53#53
Apr 19 12:41:58 named[6361]: error (network unreachable) resolving ‘’: 2001:501:b1f9::30#53
Apr 19 12:41:58 named[6361]: error (network unreachable) resolving ‘’: 2001:501:b1f9::30#53
Apr 19 12:41:58 named[6361]: error (network unreachable) resolving ‘’: 2001:67c:e0::7#53
Apr 19 12:41:58 named[6361]: error (network unreachable) resolving ‘’: 2001:500:13::c7d4:35#53
Apr 19 12:41:59 named[6361]: error (network unreachable) resolving ‘’: 2001:43f8:110::10#53
Apr 19 12:41:59 named[6361]: error (network unreachable) resolving ‘arpa/DNSKEY/IN’: 2001:dc3::35#53


Found full message in the apache error log:

apache2: Could not reliably determine the server’s fully qualified domain name, using Set the ‘ServerName’ directive globally to suppress this message

As far as I can tell it is correctly set in sites-available for each site (set to its server name so and I cannot find a global setting for the server itself.

In network settings it appears to be correctly set (although with the wrong IP address):

Can you help?

I checked Host Addresses in Network Configuration and discovered that eth0 is using the original name of the server when it was set up by OVH.

I have changed this (ages ago) on the OVH Control Panel to reflect a server name of so do not understand why this is still here. however if I change it to and save the configuration I get Error. 302 - moved temporarily. If I reboot, it goes back to the OVH server name. Again, webmin does not appear to be amending the configuaration files but I do not know where to make the changes.