Gatling ignores records in the hosts file

Hello Guys.
We work with a pack of staging environments hosted on a separate server with IP address that differs from the production one. It’s absolutely necessary for our projects to use a domain name in order to access via the web (direct IP address connection is impossible for a couple of reasons). So, we use IP → domain_name records in the hosts file on our local computers and virtual hosts on the staging server. The problem is Gatling is the only tool that completely ignores records in the hosts file and proceed connecting to the original IP address instead of using a specific ip provided in the hosts file. At the same time, there is no such problem with browsers, ssh, ftp, other network tools.
P.S. we don’t use proxy for Gatling.

Did anyone experience a similar problem? Maybe there’s some workaround. Unfortunately, we were not able to find some info regarding that.
Any help is very appreciated.
Thank you.

Which version do you use?

Hello Stéphane

We use the latest snapshot (2.2.0).
I guess it makes sense to try the stable one as well.
Thanks.

Gatling 2.2 will come with new DNS related features but those are still a WIP.
For now, in order to bring back Gatling 2.1 default behaviour, configure shareDnsCache on the http protocol.

Thanks Stéphane.

We’ve installed a stable version and the problem is gone.