VMware Cloud Community
mlubinski
Expert
Expert
Jump to solution

entries in /etc/hosts recommended by VMware?

Hi guys,

when vSphere environment (or ESX 3.5) is setup to completely use DNS resolution is there any "good practice" to fill in /etc/hosts file with all other ESX hosts (as well as VC server)? Or only DNS is enough to proceed? How does it look like in connection to best practicies?

[I]If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points[/I]
0 Kudos
1 Solution

Accepted Solutions
Troy_Clavell
Immortal
Immortal
Jump to solution

correct...

Here's an example of our hosts file on all the ESX Servers.

127.0.0.1 localhost.localdomain localhost

10.x.x.x esxname.domain.com esxshortname

10.x.x.x 1.domain.com

10.x.x.x 2.domain.com

10.x.x.x 3.domain.com

10.x.x.x 4.domain.com

10.x.x.x 5.domain.com

ignore the formatting, but there are tabs in between each IP

View solution in original post

0 Kudos
7 Replies
AndreTheGiant
Immortal
Immortal
Jump to solution

IMHO I prefer to not depend of external service.

So in small environment (2-4 ESX node) I set also a static resolution in hosts.

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

We have DNS records setup for all of our ESX Hosts, as well as all of our VMotion Ports (VMKernel). Also, the /etc/hosts file on each host has the ESX Host name (local host) with IP, shortnane and FQDN, as well as our DNS servers.

0 Kudos
fejf
Expert
Expert
Jump to solution

In my opinion /etc/hosts attracts way too much errors. Every time you add an additional host or change a name/IP you have to modify each ESX-Server (and if you use the hosts file there you also have to use it on your vCenter-Server to be consistent). So in these cases you have to modify 1 vC-Server and x ESX-Servers. This normally leads to copy&paste errors. I think it's best to use DNS-Servers and when adding an ESX-Host to your vC you see if DNS works or not (because as Best Practices tell you, you only use the FQDN for adding ;).

I only use the /etc/hosts file when there are no (configurable) DNS-Servers available.

--

There are 10 types of people. Those who understand binary and the rest. And those who understand gray-code.

-- There are 10 types of people. Those who understand binary and the rest. And those who understand gray-code.
0 Kudos
mlubinski
Expert
Expert
Jump to solution

Troy,

So I understood, that You don't use /etc/hosts file to "ensure" full name resolution takes place in case DNS is down? Only entries You have in /ect/hosts is entry with its host and DNS, no other host is entered there, right?

[I]If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points[/I]
0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

correct...

Here's an example of our hosts file on all the ESX Servers.

127.0.0.1 localhost.localdomain localhost

10.x.x.x esxname.domain.com esxshortname

10.x.x.x 1.domain.com

10.x.x.x 2.domain.com

10.x.x.x 3.domain.com

10.x.x.x 4.domain.com

10.x.x.x 5.domain.com

ignore the formatting, but there are tabs in between each IP

0 Kudos
mlubinski
Expert
Expert
Jump to solution

ok, so I misunderstood You, because You paste hosts file with all ESX's in the cluster, and I thought You rely only on DNS resolution. But now it is clear for me. I will probably do the same, so both DNS and hosts file.

[I]If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points[/I]
0 Kudos
philbard1
Contributor
Contributor
Jump to solution

To avoid sporatic networking issues between cluster members (and the VC), we put populate the host files of that particular cluster. For good measure we also put in the VC address. There are two schools of thought here however (isn't that the truth everywhere?). Manual processes seem to get forgotten and prone to human error. So, if you feel your network is unreliable at times, by all means do not trust DNS and do it locally.

0 Kudos