How To Fix: Could not determine the server's fully qualified domain name

Forums » Linux Hosting » How To Fix: Could not determine the server's fully qualified domain name
This Page Contains information about How To Fix: Could not determine the server's fully qualified domain name By toyer with 50 Replies. Last Upated: Thu Apr 24, 2014
I am getting this error everytime I try to restart my apache server. i have a dedicated server for my wallpaper website and im able to login to my fedora/redhat server through my ssh shell, but i get this when i try to restart my server for some reason i can't figure and my wallpaper website is down. this is what i get when i execute the commnad:

CODE:
Starting httpd: httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName


how can i fix this?
toyer
Loging to your Redhat server with the SSH account that was provided by our staff. Make sure you are logged in as root. If you don't have your password or forgot, please contact our support team. otherwise, execute these commands if you have your root password:

CODE:
echo HOST.DOMAIN.com > /etc/hostname

HOST = Your host name
DOMAIN = Your Domain Name

Now execute the next command in the shell:
CODE:
/bin/hostname -F /etc/hostname


Now that your server has a hostname and a domain name, restart your server with the following command:
CODE:
/etc/init.d/httpd restart


After you have restarted your server, you shouldn't see the error.
piwi
does this work on other linux distributions like Mandrake Mandriva Red Hat Fedora Core SuSE Linux Debian Woody Sarge Ubuntu Hoary Hedgehog Breezy Badger Dapper DrakeEdgy Eft CentOS
Nithin,
I am also facing the same prob but the above reply dint worked for me plz can anyone help me
piwe
hey Nithin, send this command:

cat /etc/hostname
if you don't have a hostname, you need to give your server a good hostname and a domain name. for example: hostname.domainname.com
make sure you only have one entry, its possible that you have a corupted hostname file, so i would clear it all and run the command on this post
MAKE SURE TO RESTART YOUR SERVER
Kike
you have to edit the /etc/apache2/apache2.conf and, at the end of the file, add:

# added servername to avoid the could not determine fqdn error
servername myserver

place your server name in place of myserver.

it worked for me.
MerlinGuy
thanks.

that worked great.
nihat
it's a verry good
it work !!!
thanks
burf
thanks kike, it worked for me too
helper
also check this file:

/etc/hosts

make sure it matches your hostname

i was getting this error

starting httpd: httpd: apr_sockaddr_info_get() failed for hostname.domain

httpd: could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for servername

var
http://tgrove.com/2007/12/02/httpd-apr_sockaddr_info_get-failed-for-hostname/
Boomer
ah it was /etc/hosts.
thanks
Hoddi
thanks, it works
Jim
/etc/apache2/apache2.conf and, at the end of the file, add:

# added servername to avoid the could not determine fqdn error
servername myserver

place your server name in place of myserver.

it worked for me.


and for me, clean shutdown & startup.

thanks
jim
lsfamily
my god!! it worked for me.
thanks
tl
set "servername xxx" in your apache configures.
in the command line "hostname xxx.domainname "
restart apache
nombre
looks like that fixed worked for all of you, however just encountered an issue with some sites being hosted as virtual machines with esx.

the website was hosted on a load balancer so if mahcine fails 2 would take over. for some reason apache had no route to the servername. it had to start at the vm, go through the host, and then out to the network.

did not have enough time to dig into the issue, however a soft reboot fixed it right up.
allgarbage
just add or change the servername option in your apache config file. on my debian/apache2 system the file i had to modify is /etc/apache2/apache2.conf. i added this line:

servername thugone

and then restarted apache, which started without the error.

if that doesnât work, make sure that whatever you defined as the servername is specified in your /etc/hosts file:

127.0.0.1 thugone localhost
Marquinhos
look this...
arthurfurlan.org/blog/2007/10/08/co
Bernardo
espectacular, funciono bien en mi red hat 9.
Oscar
edita el archivo /etc/hosts (fedora core) y reemplaza "localhost.localdomain" por el nombre de tu máquina "nombre.dominio "
Bruno
just set "servername yourservername" in httpd.conf

example: "servername localhost"
smokin
edit the httpd.conf (usually found at /etc/httpd/conf/httpd.conf) and change the servername entry to the name of hostname of your system. you can find the hostname by issuing the hostname command from a terminal session.
also check to see that you have a localhost entry in your hosts file (/etc/hosts).
TonyMontana
stfw or from root type "hostname localhost", if you own a domain then "hostname mydomain "
tilde
i also was getting this could not reliably determine the servers fully qualified domain name, using 127.0.0.1 for servername
Pez
hello ! to fix this problem edit /etc/hosts and add next line

::1 localhost localhost.my.domain your domain
127.0.0.1 localhost localhost.my.domain your domain


Marouane
hello, you can fix that by adding nameserver "hostname" in /etc/apache2/apache2.conf
hostname is the name of your machine.
Marouane
sorry guys it's servername "hostname" not nameserver "hostname". i had the same problem and after adding that line in the end of the file i don't receive that message when i reload or restart apache2. good luck
bobkins
good! that works for me. thanks!!!
Abbas
i had a similar problem i had originally setup apache with php 5.3.0 and later had gone on to change the php version to php 5.2.10. after the transition i could not restart the server, even after correctly specifying the php-config path and other intricacies. i finally got apache to restart by just renaming the php 5.3.0 folder to something else :)
Mike
Excellent! this works great on fedora 12!
rahma
Starting httpd: httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName I want the answer now
Kiran
Hi Please check whether you have the network part configure perfectly in /etc/hosts, /etc/sysconfig/network . You should provided your ip address hostname.domainname hostname in /etc/hosts. Kiran
James
In your /etc/hosts file make sure the fully qualified domain name is listed first. i.e.: 127.0.0.1 localhost.localdomain localhost NOT 127.0.0.1 localhost localhost.localdomain
NISHANT
Hi uncoment or add following line in httpd.conf ServerName example dot com :80
Vlad
add ServerName YOURSERVERNAME to httpd.conf

add 127.0.0.1 YOURSERVERNAME SHORTNAME to /etc/hosts

restart apache
sekhar
just go to httpd.conf file open it and add a new line i.e. servername your-server-name save it and restart the httpd service
shane
Nice post it solved my problem
Miture
I had the wrong IP address in my /etc/hosts file, removing that fixed it for me.
http://wallpaperama.com/forums/how-to-fix-could-not-determine-the-servers-fully-qualified-domain-name-t23.html
Phil
The fix is to edit the conf file and add in the ServerName setting (as the error message requests). In other words, sudo vi /etc/apache2/httpd.conf by adding the following string:, # ServerName is to be specified to avoid warning during reload ServerName MYSERVER
guzzy
great,, that fix my problem thanks
ray
thanks. cool!
rassloff
127.0.0.1 localhost 123.123.123.123 hostname.domain.de hostname
apple23
Hello, I have a question, Do I have to put my hostname in ServerName or I can put any name that I want?
casi
you shouldn't put any name that you want, depending on your DNS settings, it will not route traffic correctly.
winzter143
Whats wrong ip? the loppback ip(127.0.0.1)?
saly
Pls can you list what command should be in hosts file I have trixbox with cent5.5 operating system
Rajesh
use this in UR httpd.conf file ServerName 127.0.0.1
Nuc134rB0t
I had this problem with IP 127.0.1.1 and I commented it at /etc/hosts to solve the problem.


Umar
gedit /etc/httpd/conf/httpd.conf


ServerName root - at - localhost to


ServerName servername
Asim
I also got the same error message in a warning example.

However in web browser, the 'it works' message is displayed and all is fine the server has been linked
Karim
check resolv.conf file clear all entry and serup nameserver and write your ip

then restart network

it works my machine
harlei
explain it so plp can understand it. if u dont really know DONT SAY ANYTHING. dont try to be all cool and help unless u know what u r doing and actually tested ur solution
Title: How To Fix: Could not determine the server's fully qualified domain name [367]
Tags: how to fix could not determine the servers fully qualified domain name