We have 4 servers running in a data center, with internal IP: 192.168.3.* assigned. A hardware (FORTIGATE) firewall configured NAT, and it will lead the traffic as: external IP:

111.222.333.10 ->  www.server1.com
111.222.333.11 ->  www.server2.com
111.222.333.12 ->  www.server3.com

In DNS, we have www.server1.com A 111.222.333.10

Now if I send a lot of data to www.server1.com from www.server2.com, the data will be send through 111.222.333.10 (external IP) and this cause our bandwidth usage huge (expensive!).

The work around I have is to add a local host mapping to server2:  www.server1.com. 

That way when send files from server2 to www.server1.com, it will be internal.

However, we are having more and more servers, it would be hard to manually add mapping to every server.

Just wondering do we have another solution for this? Can we do something in the FORTIGATE firewall?

ps. The DNS server being used is public, such as opendns, Google dns etc.


No, your external bandwidth shouldn't be affected by communicating with www.server2.com.

The traffic would be routed from server1, to the fortigate, then the fortigate will send it to server2. It will never traverse the external network on the fortigate.

A static host file on each server is the best way. Write it once, then a use a simple script to push it to each host. Your alternative is to run your own DNS server, and create a split dns where internal hosts get the local ip, but others don't.

  • The traffic routed to fortigate, and back to internal. Our data center bandwidth meter still includes these traffic into our bill. Once I added to local host file, bandwidth is much much less. I am interested in your script. Does it work on both Linux and WIndows hosts file? – starchx Feb 16 '11 at 3:22
  • Ah, so they bill you for server to gateway traffic, but not server to server traffic. Then a script is the best way; I don't have one but I'd write one. It depends if your hosts are linux or windows and the OS of your host computer. – Steven Feb 16 '11 at 18:12
  • Thanks Steven. Since all Linux, I would probably use SCP command to copy hosts file to all the other servers. Thanks. – starchx Feb 27 '11 at 2:11

What are you using for DNS servers? Are you relying on something that you can control?

If you can control the DNS serevrs for all the machines you can set up split-brain DNS. This is actually even easier if you are running a DNS server for your LAN only. You would just configure it to return for server1.com instead of the public IP.

  • Good idea - but we are using the DNS server data center ISP provided, also the Google one: We have no control. We are trying to avoid building a DNS server. – starchx Feb 16 '11 at 3:15

You may be able to get the internal addresses from an /etc/hosts file. You will need to copy this to all servers. If you can't configure the file to have priority over the DNS servers, you could setup dnsmasq on a server and feed it the hosts file. Then configure the servers to refer to it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.