Fix gateway code that manipulates /etc/hosts.