Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
That's the problem. I've had my hostname set in that file for months. But when the server reboots, the hostname isn't set to that and is instead set to "zeno".
# Set the hostname.
if [ -r /etc/HOSTNAME ]; then
/bin/hostname $(cat /etc/HOSTNAME | cut -f1 -d .)
else
# fall back on this old default:
echo "darkstar.example.net" > /etc/HOSTNAME
/bin/hostname darkstar
fi
Why is it doing that? The cut line is cutting off the text at the .
Thus since I had zeno.biyg.org it simply turns into zeno. I can't have that happen, but I don't understand why it's doing that.
(The reason I can't have it set to zeno is because my email sends out from nobody@domain where domain seems to be set as the hostname, thus if it's nobody@zeno instead of the correct nobody@zeno.biyg.org, all email servers will reject the email)
Last edited by Zeno McDohl; 12-08-2007 at 02:34 PM.
Just edit your HOSTNAME file with the name you want to use and be done with it. Every system has some type of script to determine the hostname at bootup. Red Hat will have the name set in /etc/sysconfig/network
Just edit your HOSTNAME file with the name you want to use and be done with it. Every system has some type of script to determine the hostname at bootup. Red Hat will have the name set in /etc/sysconfig/network
Please read the thread. That doesn't work. I did set the HOSTNAME file as I already mentioned. But as you can see from the code I posted, the system does not fully read the file on boot. It only reads up to the first period and then stops.
What it is doing is correct. If you enter "hostname" or "echo $HOST" you should see "zeno". If you enter "dnsdomainname" you should see "biyg.com".
You should concentrate on the email part of the problem. For example, if the email is sent from a cronjob, edit the cronjob so that the email is sent to a real user.
You could have a "nobody: root" entry in /etc/aliases so that the email gets sent to root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.