Apache AH00558: “Could not reliably determine the server's fully qualified domain name”
Updated 24 November 2026 · By Brent Alexis
Short answer: AH00558 is a warning, not an error. Apache has no server-wide ServerName and your machine's hostname has no domain, so Apache picks an IP address and tells you. The config still passes and sites still load. To silence it, add one line, ServerName localhost, to Apache's main config (not inside a virtual host), test and reload.
Tested on Debian 12 (Apache 2.4.71), the official httpd Docker image (2.4.71) and AlmaLinux 9 (2.4.62), with ProxyForge's own Config Generator output: 26 checks. How it's tested
- The message
- The fix on Debian, RHEL and Docker
- Why the ServerName in your site doesn't count
- Or give the server a full hostname
- What it's hinting at: the first site catches everything
The message
Debian and Ubuntu call the server apache2; RHEL, AlmaLinux, Rocky and the official Docker image call it httpd. Otherwise the line is the same:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
It appears when you run apachectl configtest and when Apache starts (on systemd servers it also shows up in systemctl status; not lab-tested). In the lab, configtest printed it and then Syntax OK with exit code 0, and the site loaded normally. The IP address at the end is whatever Apache found for the machine's hostname.
The fix on Debian, RHEL and Docker
Add a global ServerName. localhost is enough; your server's real full hostname also works. Each of these removed the warning in the lab:
| System | Where the line goes |
|---|---|
| Debian, Ubuntu | /, then sudo a2enconf servername (a line at the end of / also worked) |
| RHEL, AlmaLinux, Rocky | A new file / |
| Official httpd image | / (it ships with #ServerName www.example.com:80 commented out) |
On Debian or Ubuntu:
echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/servername.conf
sudo a2enconf servername
sudo apachectl configtest && sudo systemctl reload apache2
On RHEL, AlmaLinux or Rocky:
echo "ServerName localhost" | sudo tee /etc/httpd/conf.d/servername.conf
sudo apachectl configtest && sudo systemctl reload httpd
Checked: after the fix, configtest printed only Syntax OK, a graceful restart was quiet, and requests for example.com still went to the example.com site. The global name doesn't change which site answers which domain.
Why the ServerName in your site doesn't count
This is the Config Generator's Apache virtual host for a static site (HTTPS and Gzip unticked). It has a ServerName:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com
<Directory /var/www/example.com>
Options -Indexes
AllowOverride None
Require all granted
</Directory>
DirectoryIndex index.html
</VirtualHost>
With it enabled, AH00558 was still there. A ServerName inside <VirtualHost> names that one site; the warning is about the server's own name, which only a ServerName outside every virtual host sets. That's what “globally” in the message means. Keep the one in your site: Apache uses it to match requests for example.com.
Or give the server a full hostname
Apache only guesses because the machine's own name has no domain (in the lab, a container called 0da69690ab04). Started with the hostname web1.example.com instead, the same Debian 12 server printed no AH00558 at all. On a real server that means setting a hostname with a domain (hostnamectl set-hostname) and making sure it resolves; that part wasn't lab-tested. The one-line ServerName is simpler.
What it's hinting at: the first site catches everything
The warning itself is harmless, but it's a good moment to check which site answers requests that don't match any ServerName. Apache sends those to the first virtual host. On a stock Debian 12 with the generator's site added:
- A request for
example.comgot the site. - A request for any other name, or for the server's IP address, got Debian's
Apache2 Debian Default Page: It works, from000-default.conf. - After
sudo a2dissite 000-default, those same requests got theexample.comsite, because it was now the first one.
apachectl -S shows the order. With both enabled it said:
default server 172.17.0.2 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost 172.17.0.2 (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost example.com (/etc/apache2/sites-enabled/example.com.conf:5)
Leaving the default page in place is usually fine. Just know that scanners and anyone typing your IP address will see it, not your site.
Generate an Apache virtual host →
How to use ProxyForge · FAQ: common errors · Guides · What's new · About