VMware Cloud Community
Sangokan
Enthusiast
Enthusiast
Jump to solution

Refresh dns on esx hosts

Hi,

Question as simple as title, how do you refresh the dns ( clear the cache, register...) on the esx hosts?

0 Kudos
1 Solution

Accepted Solutions
RParker
Immortal
Immortal
Jump to solution

cp /etc/resolve.conf /etc/resolve.conf.bak

\- Make a backup copy of the file

echo "nameserver 10.10.10.13" >> /etc/resolv.conf

\- Use an editor to modify the resolv.conf file and add your hosts

service network restart

\- Restart network service to update/activate changes

service network stop

\- will stop network services, and when you restart this will purge the DNS cache

View solution in original post

0 Kudos
6 Replies
RParker
Immortal
Immortal
Jump to solution

cp /etc/resolve.conf /etc/resolve.conf.bak

\- Make a backup copy of the file

echo "nameserver 10.10.10.13" >> /etc/resolv.conf

\- Use an editor to modify the resolv.conf file and add your hosts

service network restart

\- Restart network service to update/activate changes

service network stop

\- will stop network services, and when you restart this will purge the DNS cache

0 Kudos
El_Faraon
Contributor
Contributor
Jump to solution

Hello, i have a question, the /etc/resolv.conf is for the DNS servers only?.

Because when you want to use a local DNS uses the /etc/hosts .

But, in my case, i use the etc/hosts, all the hosts are defined, but when i type >hosts 192.168.1.88 , it can resolve it.

Why? is necesary to put it into the resolv.conf? i think no.

Regards

0 Kudos
kjb007
Immortal
Immortal
Jump to solution

The /etc/hosts file is a local mapping file that only works for static entries on that host. The /etc/resolv.conf is to configure centrally managed DNS servers. The /etc/hosts file is manually maintained, and those entries will override what you have in DNS. If you don't mind manually editing every /etc/hosts file in your environment for every host name modification or addition, then you are ok. Otherwise, you configure DNS and have the addresses modified/added/deleted in one place and have them dynamically updated everywhere.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
kaneda
Contributor
Contributor
Jump to solution

Hi,

I know this is a old thread however I have a question regarding restarting the network service - will this have any adverse effect on the VMs that are currently running? Especially as there is also VMotion invovled.

0 Kudos
mcowger
Immortal
Immortal
Jump to solution

Restarting the network service wont interrupt any running VMs, but could impact an in progress VMotion.

--Matt

--Matt VCDX #52 blog.cowger.us
0 Kudos
kaneda
Contributor
Contributor
Jump to solution

Thanks Matt!

0 Kudos