Map host name to IP address from within public gitlab ci pipeline

I need a custom host name to be resolved to 127.0.0.1 IP for one of my test stages in gitlab ci. Is there a way to do it with gitlab-ci.yml?

@jCalamari have you found a solution to your problem? Thanks.