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:
  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:

Visit my FB page:

Subscribe to my YouTube channel:

Please leave the comment