1
How to automate local DNS entries per project?
(feddit.de)
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
Not a DevOps eng so this might not be the most elegant answer but you could write an Ansible playbook to edit a hosts file on the target server and trigger that after deployment, within your CI/CD pipeline.
In an ideal situation, though, all your servers connect to a centralised DNS server (usually your gateway) where those domain names are managed.