First of all, R77.30 is End of Support and you should upgrade to a supported release.
R80.20+ has the concept of Updatable Objects where we have an object that includes this already, which would make this a lot easier.
In R77.30, it really depends on precisely how those DNS names will be accessed as to which approach you should take, but it will either be a Domain Objects (which may not work and will cause performance issues) or Custom Application/Site (which will work for access via HTTPS, but nothing else).