How to add domain search to DNS settings in vCenter Server Appliance 7.x (NOT via VAMI)

Today I discovered that I had issue with DNS in my VCSA. I could not resolve servers without suffix.

I decided to check resolv.conf file and I notice there was no Search Domain present.

OK, how to add Search Domain? I asked uncle Google, but there was no answer. The only answers were for vCenter 6.x and older. Nothing for 7.x.

In VAMI there is an option to change your DNS settings, however there is no option to add Search Domain.

The resolv.conf is not editable. I mean you could do the changes but it will be overwritten.

Here is a simple way how to add Domain Search to vCenter 7.x:

  1. SSH to VCSA
  2. Run this command to make a backup file
cp /etc/systemd/resolved.conf /etc/systemd/resolved.conf-OLD
  1. Edit /etc/resolv.conf and add Domains:
[Resolve]
DNS=192.168.88.22
FallbackDNS=8.8.8.8
Domains=yourdomain.local
  1. Save the file
  2. Restart service:
service systemd-resolved restart
  1. Check the status:
systemd-resolve --status

After this I could resolve name without suffix! And once cat /etc/resolv.conf the Domain Search was there.

Please like and share to spread the knowledge in the community.

If you have a questions, let’s chat on Twitter: https://twitter.com/AngrySysOps

Visit my FB page: https://www.facebook.com/AngrySysOps

Subscribe to my YouTube channel: https://www.youtube.com/channel/UCRTcKGl0neismSRpDMK_M4A

Please leave the comment