OpenUserX03
OpenUserX03

Reputation: 1458

DNS issue with graph.facebook.com

On iOS, I'm having issues with the DNS lookup for graph.facebook.com failing, but only when I'm on using cellular data. My service provider is AT&T.

If I try to visit http://graph.facebook.com in Chrome, the page returns ERR_NAME_NOT_RESOLVED.

Naturally, this is causing issues in my app that uses the Facebook SDK, since the SDK makes API calls to graph.facebook.com.

If I turn on wifi, everything works fine since a different DNS server is used than the one used when I'm using cellular data.

If I reboot my device then http://graph.facebook.com works for awhile, but then randomly the dns lookup will start failing again when using cellular data.

Is this problem with AT&T and their dns servers? Is there anything I can do on my side to address the issue without resorting to changing the default DNS server (which my users will not know how to do).

Upvotes: 0

Views: 1169

Answers (1)

anthumchris
anthumchris

Reputation: 9072

I had the same issue, and just contacted FB on Twitter. Seems the IP6 record is not resolving correctly in certain places. Resolves correctly for me in Colorado, but not for my server in Dallas.

Server-Side SDK Implementations

Set your DNS records in /etc/hosts to the correct (as of today) host name. Remember, this is only a temp fix, because their IPs may change.

# IP6
2a03:2880:f00b:1:face:b00c::1 graph.facebook.com

# IP4
31.13.74.1      graph.facebook.com

Client-Side SDK Implementations

Since you can't modify users' devices' /etc/hosts file, you could write a server-side service that uses the FB SDK. This service would act as a proxy or façade for your app, and your app can call your custom service directly. FB SDKs are here, and I use the PHP SDK to manage authenticated FB sessions and user persistence. https://developers.facebook.com/docs/apis-and-sdks

Upvotes: 1

Related Questions