@sarthak if I understand correctly, what you need to do is add more than one hostname alias to the same virtual host definition.
How you do this depends whether you want to create a new virtual host or update an existing one.
Create New:
curl -X POST -H "Content-Type:application/json" \
[http://{ms-ip}:8080/v1/o/{org}/environments/{env}/virtualhosts](http://{ms-ip}:8080/v1/o/{org}/environments/{env}/virtualhosts) \
-d '{
"name": "{vhostname}",
"hostAliases": ["{alias1:port}", "{alias2:port}"],
"port": "{portnumber}"
}' \
-u {sysadmin email}:{sysadmin password}
If you want to configure interfaces and /or SSL parameters then those can be added as well. See: Create a Virtual Host for more details.
Update Existing:
The main thing here is you need to confirm current virtual host configuration because you need to include whatever existing configs you want to retain along with the extra config in the put.
GET existing virtual host configuration:
curl -v "http://{ms-ip}:8080/v1/organizations/{org}/environments/{env}/virtualhosts/{vhostname}" -u {sysadmin email}:{sysadmin password}
PUT updated virtual host configuration:
curl -X PUT -H "Content-Type:application/json" \
[http://{ms-ip}:8080/v1/o/{org}/environments/{env}/virtualhosts/{vhostname}](http://{ms-ip}:8080/v1/o/{org}/environments/{env}/virtualhosts/{vhostname}) \
-d '{
"name": "{vhostname}",
"hostAliases": [{alias1:port}", "{alias2:port}", {alias3:port}"],
"port": "9008"
}' \
-u {sysadmin email}:{sysadmin password}
As above, there are additional parameters, refer to Update a Virtual Host for more details.
And one last reference, there’s some extra details along with other reference links on the other configuration you might need if you’re using SSL, for example the trust store and key store updates along with XML versions of above available in the following: Creating a virtual host for a Private Cloud installation