Is there an action to get the environment hostname? 


It did not get the domain


I want the DNS value in the properites table, but there is no built in function to get this information.


I believe the following thread answers your question:

There you can find the following query which retrieves what you need:

FROM [ossys_Parameter]
WHERE [NAME]='DefaultDnsName'