Operating System - Linux
1828667 Members
1927 Online
109984 Solutions
New Discussion

/etc/hosts syntax plz help

 
SOLVED
Go to solution
Maaz
Valued Contributor

/etc/hosts syntax plz help

I have configured the sendmail sever for two email domains
(1)test.com and for (2)abc.com

/etc/mail/local-host-names
test.com
abc.com

#host -t mx test.com
test.com mail is handled by 5 mail.test.com.
# host mail.test.com
mail.test.com has address 10.2.100.101

#host -t mx abc.com
test.com mail is handled by 5 mail.abc.com.
# host mail.abc.com
mail.abc.com has address 10.2.100.101

Now should I also make some updates to /etc/hosts file ?
#cat /etc/hosts
127.0.0.1 localhost.localdomain localhost

Any Recommendations/suggestions/Best Practices will be Highly Appreciated

Thanks n Regards
Maaz

2 REPLIES 2
Ivan Ferreira
Honored Contributor
Solution

Re: /etc/hosts syntax plz help

It doesnt really matter how you configure it, always that you have all network interfaces with a different name in the file.

The hostname in /etc/hosts does not need to match the DNS name, so you /etc/hosts entry could be anything like this:

10.2.100.101 server1.abc.com server1 mail test
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: /etc/hosts syntax plz help

Shalom Maaz,

I think Ivan is saying you don't need to change this. If so, I agree.

For sanities sake, I put aliases in the /etc/hosts file. Especially when microsoft servers are involved with dns, files on linux is faster.

Never change the localhost line.

192.168.0.10 bersheva bersheva.itool.com abc-mx

Any alias you want, as many as you can stand to look at.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com