Google Geocode API IP restrictions - google-geocoder

When using IP restrictions for the Geocode API, what IP address should I put there? The IP address returned by a Google search of "What is my I.P."? Or the I.P address of the server where the application/website files are hosted?
I have a website under inMotion Hosting and I tried to put their i.p as in the restrictions, but that doesn't seem to work.
I don't think I have to put the internet I.P address of everybody who visits my website since I cannot know who will visit and where.
Please let me know, I'm confused

you either have to pass ...
a) the server's IP, when geo-coding server-side (PHP API) or
b) the client's IP, when geo-coding client-side (JS API).
the server's IP should be known, for the client-side IP, see this Q&A.
in principle, it's always the IP of the party which actually requests data.

Related

IP based Google API key restriction problem

I'm using Google YouTube Data API v3 on a PHP based website and it works fine if there is no access restriction. APIs are called only from the server and not from client side.
However, if I setup a IP based restriction then all requests are blocked. It seems, that I set a wrong IP. I have already double checked the IP on my server and with ping as well and it is correct.
Any idea, what can be the problem?

How do sites like Airbnb know my location without my consent?

See screenshot below. Airbnb knew my location was in Los Angeles. I visited the page in incognito mode. I'm not logged in. I did not consent to geolocation via HTML5 (the browser didn't even prompt me). So how do sites like Airbnb know my location?
My guess is with my IP address. If that's the case, could someone show me how I could replicate that if I were to build a site? Is there an API by Google or someone that provides that service? As far as I can tell the majority of Google Maps' API requires some sort of user input.
Airbnb_screenshot
How do sites like Airbnb know my location without my consent?
Through IP Address Geolocation. If you visit https://www.ipinfo.io, you will see that that your geolocation estimate is fairly accurate. But you haven't provided that service any kind of location permission, hence the word "estimate".
For IP Geolocation:
They don't need a permission for IP Geolocation through HTML5
They only need your IP address
To populate the location information from the IP address, the IP geolocation service provider will aggregate data from various sources and perform analytics to come up a with an estimated location which is accurate on a city or postal code level.
But because this data is collected from IP addresses, changing your IP address through a VPN or hosting can result in inaccurate IP geolocation address. But IPinfo can detect VPN usage as well:
disclaimer: I am the developer success manager at IPinfo
Nowadays, it quite common to geolocate users based on their IP addresses. Despite what people may argue, IP geolocation, especially country estimation is really accurate (more than 99% for IP addresses assigned in developed countries).
Some users may hide their real IP address using a proxy. That's why services such as Ipregistry (disclaimer: I run the service) include threat data along with IP geolocation data. This way you can detect suspicious IP addresses.
Getting information is as simple as calling an HTTP endpoint:
https://api.ipregistry.co/?key=tryout

URL shortner Api

I am using URL Shortener API to shorten our mobile app download link. (https://www.googleapis.com/)
We have some restrictions on our server such that we don't allow unrecognized IP access.
So I would like to know what would be the IP range that googles use when the URL is shortened using this API (https://www.googleapis.com/).
This will help us to configure our security settings to allow access to these IP's
google-apis-explorer
When you say "using the URL Shortener API", are you referring to making calls to this API from your server (as in outbound traffic is IP restricted) or using the short URL to reach your server (as in inbound traffic is IP restricted)? I'll go ahead and answer both possibilities, but please clarify if these weren't what you meant.
If you're trying to allow calls to this API from your server with outbound traffic IP restricted
The URL shortener API can be called through any of Google's IP addresses. There's no way to get a list of these because they will vary by location, load balancing, etc. Plus, you wouldn't want to attempt to restrict by IP this way because whitelisting even one of Google's IP addresses would allow calls from your server to all of Google's services. This likely includes any service hosted on Google Cloud, which could be a proxy, meaning literally anything in the world could be called this way; you'd be entirely eliminating IP restrictions on your server.
If you're trying to shorten your server's URLs using this API and your server has inbound traffic IP restricted
You shouldn't need to do anything. These URLs are just domain redirects. In the end, the user ends up visiting your website (server) using its actual long URL (there's no proxying), so just whitelist the allows users' IPs and it should work.

Hosting with Static/Fixed IP Address

I have been search for a host that has static/fixed ip address. Right now i use mediatemple's grid server and because it is a shared environment the ip address is dynamic and changes randomly.
My issue is that i have a script on my sever that fetches data from an ftp site. To access the data via ftp, i have to authenticate using an ip address, username and password. Because the ip address is ever changing, i cannot access the data.
One alternative was asking the data company if they would accept a range of ip address or a wildcard but they will not. they will only approve one ip address for download.
The other option was to purchase a self managed server. I do not want to manage my own server nor do i have the expertise to do so. So I need a solution like a shared environment (low cost) with a cpanel but one that has fixed ip address.
Any suggestions would be much appreciated.
You should look for "managed server" or "VPS" solutions.
Which host you choose is up to you. Many hosts offer such solutions, and a smaller host might fit your budget better than a "big name" hosting company.
This is really surprising ... usually in a shared hosting account where your site is hosted on a shared IP, the shared IP address is always fixed it rarely changes. I think you're right now on CDN hosting, so your data delivery IP address varies according to your VISITOR location.
I am hosting my various sites like thewebhostingdir.com and etc at http://www.accuwebhosting.com/ ... on shared hosting and their IP address is fixed since the hosting setup.
I suggest you to change your hosting provider. You don't need VPS at this moment.
I found a solution. Godaddy vps virtual server starting at only $29.

Can I use google to determine vhosts on same IP?

Can I use google -- specifically i am thinking of the google ajax api -- to enumerate a list of host names of websites that are hosted on a particular IP address.
Note
Yes, I know that other mechanisms, such as MSN search and obviously DNS services can be used, but I am specificially looking for whether a google solution exists.
AFAIK Google doesn't give out the IP addresses in its search results (unless the URL is only accessible from IP address rather than a host name).
I know you only want Google solutions, but have you tried My IP Neighbors? You put in a URL or IP and it gives you the sites also hosted on the IP.
Not sure you can do with google ajax api; however I think that the best solution would be more oriented towards a sysadmin job (thus ask serverfault..), mainly:
find which nameserver is authoritative for such website
find out which other domains using that nameserver as authoritative
simply because websites hosted on the same server are often served by the same DNS.
On a side note, since a DNS can be authoritative for other domains (not hosted on that IP), you might want to double-check that list and do a lookup on all domains, filtering out those that are hosted on a different server.
This leaves open the question of load balancing, tho: what if a domain is hosted on more than one server?
The answer is left as an exercise to the reader. :)
I searched through Google's forums for SEO Q&A and technical Q&A. The issue of whether Google captures IP addresses is not directly addressed. However, there is at least one answer which suggests Google doesn't care about IP addresses (see squibble's second response.)

Resources