Apple DNS name which has only IPv4 addresses

Hello Apple team,

Our servers does not support IPv6 addresses. When we are sending the push notifications, if it is IPv4 address, it is working and when when it is IPv6 address, we are getting below exception.

Caused by: io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: api.push.apple.com/2620:149:208:430d:0:0:0:a:443
Caused by: java.net.SocketException: Network is unreachable
	at sun.nio.ch.Net.connect0(Native Method)
	at sun.nio.ch.Net.connect(Net.java:481)
	at sun.nio.ch.Net.connect(Net.java:473)
	at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:662)
	at io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:91)
	at io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:88)
	at java.security.AccessController.doPrivileged(AccessController.java:746)
	at io.netty.util.internal.SocketUtils.connect(SocketUtils.java:88)
	at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:315)


Can we get DNS name which has only IPv4 addresses so that we can add allow communication to only those DNS.


Please let us know.


Thanks.


Posted on Aug 6, 2024 7:00 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 6, 2024 7:28 AM

Hi ravipardeshi02,


I understand your situation. Since your servers cannot handle IPv6 addresses, you want to ensure communication happens only with the IPv4 addresses of api.push.apple.com. Here's what you can do:


1. Leverage Existing IPv4-Only DNS Servers:


* Look for public DNS servers known to primarily serve IPv4 addresses, such as some offered by Google (8.8.8.8 and 8.8.4.4) or Cloudflare (1.1.1.1 and 1.0.0.1).


* Configure your servers to use these DNS servers. This increases the likelihood of resolving api.push.apple.com to its IPv4 address.


2. Utilize DNS Query Tools with IPv4 Preference:


* Use tools like dig or nslookup on your server to query for the A records (IPv4 addresses) of api.push.apple.com.


* These tools allow specifying record types. Run a command like dig A api.push.apple.com to retrieve only IPv4 addresses.


* If the query returns results, use those IPv4 addresses directly in your push notification code instead of relying on the hostname.

Important Considerations:


* Dynamic IP Addresses: Apple might dynamically assign IP addresses to api.push.apple.com. You might need to periodically re-run the DNS query to capture any changes.


* Performance Impact: Using a specific set of DNS servers might impact performance compared to using your default DNS settings.

Alternative Approaches:


* Contact Apple Support to inquire about alternative ways to interact with their push notification service that wouldn't involve IPv6 addresses. They might offer a dedicated endpoint with only IPv4.


* Upgrade Servers (if possible): If upgrading your servers to support IPv6 is feasible in the long run, it would be the most future-proof solution.


Recommendation:

Start by trying the Public DNS Servers approach (IPv4-only). If that doesn't work consistently, consider using the DNS Query Tools method or contacting Apple Support. Upgrading your servers to support IPv6 would be the ideal long-term solution but might have resource constraints.


Hope that help!

1 reply
Question marked as Top-ranking reply

Aug 6, 2024 7:28 AM in response to ravipardeshi02

Hi ravipardeshi02,


I understand your situation. Since your servers cannot handle IPv6 addresses, you want to ensure communication happens only with the IPv4 addresses of api.push.apple.com. Here's what you can do:


1. Leverage Existing IPv4-Only DNS Servers:


* Look for public DNS servers known to primarily serve IPv4 addresses, such as some offered by Google (8.8.8.8 and 8.8.4.4) or Cloudflare (1.1.1.1 and 1.0.0.1).


* Configure your servers to use these DNS servers. This increases the likelihood of resolving api.push.apple.com to its IPv4 address.


2. Utilize DNS Query Tools with IPv4 Preference:


* Use tools like dig or nslookup on your server to query for the A records (IPv4 addresses) of api.push.apple.com.


* These tools allow specifying record types. Run a command like dig A api.push.apple.com to retrieve only IPv4 addresses.


* If the query returns results, use those IPv4 addresses directly in your push notification code instead of relying on the hostname.

Important Considerations:


* Dynamic IP Addresses: Apple might dynamically assign IP addresses to api.push.apple.com. You might need to periodically re-run the DNS query to capture any changes.


* Performance Impact: Using a specific set of DNS servers might impact performance compared to using your default DNS settings.

Alternative Approaches:


* Contact Apple Support to inquire about alternative ways to interact with their push notification service that wouldn't involve IPv6 addresses. They might offer a dedicated endpoint with only IPv4.


* Upgrade Servers (if possible): If upgrading your servers to support IPv6 is feasible in the long run, it would be the most future-proof solution.


Recommendation:

Start by trying the Public DNS Servers approach (IPv4-only). If that doesn't work consistently, consider using the DNS Query Tools method or contacting Apple Support. Upgrading your servers to support IPv6 would be the ideal long-term solution but might have resource constraints.


Hope that help!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apple DNS name which has only IPv4 addresses

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.