following this guide hostname = ns1.itemalls.com hostname -f = ns1.itemalls.com but after reboot it's changed to hostname = ns1 hostname -f = ns1.itemalls.com is it correct?
It's the correct procedure. hostname -f, the -f means the fully qualified domain name of the server. Without the -f you just get the hostname, which is the name of the server (without the domain name).
Most probably depends on what you typed when asked originally. What is stored in /etc/hostname and initiated at boot by /etc/init.d/hostname.sh Take a look in those files and also view the manual for hostname (man hostname) and you will understand how it works.