I have a small web server running on port 80, and I'd like to allow only Google Translate to have access to it.
First I tried running
dig translate.google.com and
dig translate.googleusercontent.com to get the IP address for it, which returned addresses ranging from 220.127.116.11 to 18.104.22.168.
Then I opened the mentioned ports, but it did not work. Looking at iptables logs, I found Google has very different IP addresses to open the target website for translation. In a few tests they ranged from 22.214.171.124 to 126.96.36.199.
Now, what I've got so far is the following rule, that opens the door for this range:
-A INPUT -p tcp --dport 80 -m iprange --src-range 188.8.131.52-184.108.40.206 -j ACCEPT
- Everytime Google tries to access the page, it uses a different IP address, and probably out of the range I mentioned previously. I'd have to try many many times to take note of all the range.
- I'm concerned about the security implications also, since I don't know whether all IPs in the range are safe to leave open (would they all belong to Google?)
nslookup 220.127.116.11 to see if I could get a domain name for it, but it returns:
** server can't find 18.104.22.168.in-addr.arpa.: NXDOMAIN