Linux modify hostname

  

If Linux wants to send mail using sendmail or Exim, etc., it is essential to configure the correct hostname.

Check if your hostname is correct. Check the host command as:

hostname -f

If the hostname is not a correct domain name, you need to modify it. Modify the host name is divided into 3 steps, for example, my host name should be set to ahuang.org:

1.hostname modify the host name

hostname ahuang.org

2. Modify the /etc/hosts file

vim /etc/hosts

The contents are as follows:

127.0.0.1 localhost.localdomain localhost

173.255.246.150( Actual IP) ahuang.org ahuang

3. Modify the HOSTNAME line in /etc/sysconfig/network. If it does not exist, add

vim /etc/sysconfig/network

Content is

HOSTNAME=ahuang.org

Now, test if Sendmail can send mail normally:

echo "Subject: test"

How to backup and restore the registry in Win10 preview

</a></p> <p><a href='https://www.windows10windows7.com/w8/win8wt/100107249.html' target="_blank">Four Steps to Create the World Unparalleled Windows 8</a></p> <p><a href='https://www.windows10windows7.com/w8/gywin8/100116665.html' target="_blank">How to cancel the application being installed when installing Win8 system</a></p> <p><a href='https://www.windows10windows7.com/windowsjc/gywin/100104386.html' target="_blank">Win7/Win8.1 system upgrade Win10 official version has been flashing how to solve </a></p> <p><a href='https://www.windows10windows7.com/windowsjc/gywin/100169526.html' target="_blank">Microsoft adds new features to the Windows Development Center: improving the application submission process, downloading icon badges, etc. </a></p> <p><a href='https://www.windows10windows7.com/w7/win7jq/100162175.html' target="_blank">After the laptop is turned on, why is it </a></p> <p><a href='https://www.windows10windows7.com/w7/win7jq/100140109.html' target="_blank">8 reasons why you don't have to upgrade Windows 7 SP1 </a></p> <p><a href='https://www.windows10windows7.com/w7/win7jc/100195010.html' target="_blank">How to cancel the Win7 system automatically pop up the dial-up connection dialog? </a></p> <p><a href='https://www.windows10windows7.com/linux/linuxjc/100154813.html' target="_blank">Interserver VPS ovz architecture assumes that VPN</a></p> </div> </div><div class=wxf4></div> <div class="m2"> <div class="ekmbngbx ekmbngbx_c"> <label>Windows system</label> </div> <div class="uierbxbsh lihen l120 ovnpxrx_win pdt"> <li class=lm><a href="/wxp/">Windows XP System Tutorial</a></li> <li class=lm><a href="/w7/">Windows 7 System Tutorial</a></li> <li class=lm><a href="/w8/">Windows 8 System Tutorial</a></li> <li class=lm><a href="/w10/">Windows 10 System Tutorial</a></li> <li class=lm><a href="/win2003/">Windows 2003 System Tutorial</a></li> <li class=lm><a href="/win2008/">Windows 2008 System Tutorial</a></li> <li class=lm><a href="/windowsvista/">Windows Vista System Tutorial</a></li> <li class=lm><a href="/windowsjc/">Windows tutorial synthesis </a></li> <li class=lm><a href="/windowsserver/">Windows Server System Tutorial</a></li> <li class=lm><a href="/linux/">Linux system Tutorial</a></li> <li class=lm><a href="/ruanjian/">Computer software Tutorial</a></li> <li class=lm><a href="/windowsnt/">Windows NT Tutorial</a></li> </div> </div> </div> </div> <div class="qcieb_es_1"></div> </div> </div> <div class="diianbgdag"> Copyright © <a href="https://www.windows10windows7.com" target="_blank" title="">Windows knowledge</a> All Rights Reserved <script language='javascript' src='https://www.windows10windows7.com/AD/b.js'></script> </div> </body> </html>