Home / Linux / How to fix qualified domain name

How to fix qualified domain name

When you restart your apache server using the command

sudo /etc/init.d/apache2 restart

Someone get the following error:

Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2:
Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

Let’s go fix this issue !

This is just a friendly warning and not really a problem (as in that something does not work).

If you insert a

ServerName localhost 

in either httpd.conf or

apache2.conf in /etc/apache2 

and restart apache the notice will disappear.

If you have a name inside

/etc/hostname

you can also use that name instead of

localhost

And it uses

127.0.1.1

if it is inside your

/etc/hosts
127.0.0.1 localhost
127.0.1.1 myhostname

Use a text editor such as “sudo nano” via command line or “gksudo gedit” on the desktop to create a new file,

sudo nano /etc/apache2/conf.d/fqdn 

or

gksu "gedit /etc/apache2/conf.d/fqdn" 

then add
ServerName localhost
to the file and save. This can all be done in a single command with the following:

echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf 
sudo a2enconf fqdn 

About Rasel Khan

This is Rasel Khan, I’ve been working with the computers since I was pretty young. Right now, I’ve completed graduation for B.Sc(Engg) in Computer Science & Engineering (CSE) in 2014 at Jatiya Kabi Kazi Nazrul Islam University, Trishal, Bangladesh. For almost a decade now, I’ve been playing around with over a dozen programming languages on several different platforms, from JavaScript to PHP, from Python to Django. My favourite has always been PHP.

Check Also

How to fix network service discovery disabled

It looks like avahi-daemon is started when the network connection is established ( ). This …

One comment

  1. I absolutely love your site.. Great colors & theme.

Leave a Reply

Your email address will not be published. Required fields are marked *