I'm trying to put search domains into resolv.conf from my IPAM plugin. The data is passed to vmtools but I cannot get multiple values appear correctly in resolv.conf.
AllocationResults passed to vRA:
[
{
"IPAddresses":[
"192.168.30.7"
],
"AllocationRequestId":"f3f3ce9b-3b54-41d3-9e86-158f3c99aca2",
"RangeId":"11",
"IPVersion":"IPv4",
"SubnetPrefixLength":"24",
"Gateway":"192.168.30.1",
"PrimaryDNS":"8.8.8.8",
"SecondaryDNS":"8.8.4.4",
"PrimaryWINS":"",
"SecondaryWINS":"",
"DNSSuffix":"domain1.local",
"DNSSearchSuffixes":"domain1.local domain2.local"
}
]
Resulting resolv.conf:
# Generated by NetworkManager
search domain1.localdomain2.local
nameserver 8.8.8.8
nameserver 8.8.4.4
So the whitespace is removed, and this is not good. I tried to separate the values with comma and also make DNSSearchSuffixes an array (like IPAddresses) but neither of them worked, there was nothing in the resulting resolv.conf
Logs:
$ grep SUFFIX /var/log/vmware-imc/toolsDeployPkg.log
DEBUG: Processing line: 'SUFFIX|1 = domain1.localdomain2.local'
DEBUG: ADDED KEY-VAL :: 'DNS|SUFFIX|1' = 'domain1.localdomain2.local'
INFO: Query config for ^(DNS\|SUFFIX\|)
DEBUG: Match Found : DNS|SUFFIX|1
INFO: Query config for ^(DNS\|SUFFIX\|)
DEBUG: Match Found : DNS|SUFFIX|1
INFO: Query config for ^(DNS\|SUFFIX\|)
DEBUG: Match Found : DNS|SUFFIX|1
It looks like that the value is already modified by vRA(?). How can I pass multiple values of search domains?
Same issue 5 years ago? Delimeter for Properties in VirtualMachine.NetworkN.DnsSearchSuffixes
Custom Properties Reference writes:
Is this supported on Windows only? Commas did not work for Linux...