View Full Version : Server question - changing hostname
blazenet 03-03-2001, 10:54 AM Hello,
I'm having some QMail problems, it doesn't matter what, but to fix it, I need to change my server's hostname from "localhost.localdomain" to a fully qualified hostname. How do I do this with RedHat Linux 7.0 ? I tried
hostname -v blazebox.com
and when I do that, it indeed says it is updated, and when I execute "hostname", it indeed gives "blazebox.com" , but when I restart Apache, PHP still says its hostname is "localhost.localdomain" , and when I do a reboot, and then execute hostname, it says "localhost.localdomain" again...
Anyone knows an answer to this?
Thanks in advance.
Si-WHN 03-03-2001, 05:19 PM can you tell me a little more with teh problem you're experiencing?
Are you getting serious lag and timeouts when trying to connect to pop3 and smtp?
and thirdly are you running the tcpserver or inetd with qmail?
regards,
Simon
nopzor 03-03-2001, 05:41 PM Make sure the hostname is set in /etc/hosts
jayglate 03-03-2001, 05:49 PM Try checking your httpd.conf file, did you change it in there in the ServerName field. For qmail go into
/var/qmail/control look in the "me" file what does it say there?
nopzor 03-03-2001, 06:54 PM You shouldn't have to specify the ServerName in your httpd.conf file; it should be able to figure it out automatically. That directive was put in there for OS's with severely borked networking.
If memory serves me correctly check in /etc/sysconfig/network
Dylan 03-03-2001, 08:52 PM Si-WHN, I think mailservers are rejecting mail sent over his server because his hostname is what filters call forged.
DHWWnet 03-04-2001, 08:30 PM Originally posted by Si-WHN
Are you getting serious lag and timeouts when trying to connect to pop3 and smtp?
and thirdly are you running the tcpserver or inetd with qmail?
in email :), im getting 30-40 seconds timelag when accessing pop3.
Im also runnin qmail on tcp. what do you think is the correct config.?
ps: hostname is srvr4.domain.com
thanks
elijaH
[Edited by elijah on 03-05-2001 at 02:18 AM]
blazenet 03-05-2001, 02:05 AM Yeah, the mail send through PHP was rejected because PHP tought my hostname was localhost.localdomain .... solution: change the hostname to a "real" hostname, and it's fixed...
I don't have any form of lag or something... I just kept getting the following message in /var/log/maillog :
Mar 2 09:25:14 localhost qmail: 983546714.909828 delivery 19666: failure: Connected_to_212.72.39.208_but_sender_was_rejected.
Now everything works smoothly :)
Dylan 03-05-2001, 05:53 AM And how did you manage to change the hostname successfully?
blazenet 03-05-2001, 09:45 AM 1) hostname -v blazebox.com
2) edit /etc/hosts
3) edit /etc/HOSTNAME (RedHat 6.x only I believe)
4) edit /qmaildir/control/me
I only did the first 2 steps.... just to be sure, I did a "shutdown -r now" ... I don't know if it was necessary, but it never hurts....
Dylan 03-05-2001, 01:09 PM Anybody know how to do this with Plesk?
"me" is correct.
DHWWnet 03-05-2001, 07:31 PM This is what i did in ssh:
I edited the /etc/hosts and added the ff line:
209.217.0.0 srvr4.domain.com srvr4
and: /etc/sysconfig/network:
NETWORKING=yesFORWARD_IPV4=falseHOSTNAME=srvr4.domain.comDOMAINNAME=domain.comGATEWAY=209.217.1.1GATEWAYDEV=eth0
and rebooted my system =)
i still havent solve the qmail lag prob, but it seems to me that it is dns related cuz im trying to network 3 different servers with 1 domain :P doh!
later...
elijaH
Dylan 03-05-2001, 07:53 PM That's not for Plesk is it?
blazenet 03-06-2001, 06:32 AM Plesk is not an issue here.... I used Plesk, and it worked.... Plesk doesn't use the hostname, PHP does.... restart Apache, PHP will be restarted, and you got your new hostname lighten up in PHP :)
Dylan 03-06-2001, 04:06 PM Nope, none of that exsists...
blazenet 03-06-2001, 04:50 PM You have ICQ or MSN messenger? That talks a little better, and probably I can help you....
lmergen@hotmail.com or 55677353 (ICQ is preferred)
Dylan 03-06-2001, 05:24 PM I've got MR.
Here's my problem:
sendmail uses the correct host.domain.com
BUT
sendmail.plesk uses localhost.localdomain
me and the host name is correct.
So I've no idea where it's pulling this info from.
blazenet 03-06-2001, 05:26 PM Plesk doesn't use sendmail, it uses QMail
That was my problem.... I had to change PHP's sendmail to QMail
Dylan 03-06-2001, 05:38 PM umm... sendmail/sendmail.plesk is for scripts and qmail is for SMTP... check it out...
DHWWnet 03-07-2001, 02:08 AM Mines on plesk too :) after changing the servers hostname i wasnt able to use qmail , course i forgot to enable smtp :P ... its working now.
thing is that sendmail stopped working and i need it to work :(... i'll keep you posted once i have a solution to it (if i ever have one :()and pop3 still lags.
elijaH
blazenet 03-07-2001, 06:14 AM I am using /usr/local/plesk/qmail/bin/qmail-inject as my mailer program for PHP, and it works better than perfect :)
But what exactly is your problem?
Dylan 03-07-2001, 09:54 AM Look at my post "plesk reconfigurator" maybe that will help you more.
Si-WHN 03-09-2001, 11:46 PM we had a similar problem with timeouts on a previous server running qmail and vpopmail.
It was due to reverse lookups occuring everytime someone connected either via smtp or pop3.
From memory the parameter you need to add to your tcpserver config line (perhaps in /etc/rc.d/rc.local?)
is
tcpserver -Hl your.host.name otherparams follow here
That will force tcpserver to use the hostname specified and stop it doing a reverse dns lookup on the hostname that you're running qmail on.
Hope this helps.
regards,
Simon
DHWWnet 03-10-2001, 03:03 AM Thanks man :) i will look into it tomorrow.
Si-WHN 03-10-2001, 08:11 PM no problemo, let me know how it goes :-)
regards,
Simon
|