How to change the DNS server used by ExoPlayer
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
### ExoPlayer Version
2.16.1
### Devices that reproduce the issue
Any android device
### Devices that do not reproduce the issue
_No response_
### Reproducible in the demo app?
Not tested
### Reproduction steps
Sometimes, ISP does fail to resolve hostname to IP and player ends up in below error,
**Exception caught : HttpDataSourceException: Unable to connect to** myhostname.com, **Unable to resolve host** myhostname.com: **No address associated with hostname, android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)**
How to set external DNS server url on exoplayer so that all master, variant and segment request by player uses newly set DNS server to resolve hostname to IP and streaming works fine.
Or any option to set backup DNS url so that exoplayer can internally use it if at first attempt it's not able to resolve host.
This issue is seen in field and not locally reproducible since its related to ISP not resolving hostname.
It's seen across domain names and using external DNS servers would help to resolve IP which fixes playback failure issues.
Tried browsing through multiple forums, no luck and hence raising ticket here.
### Expected result
API to set DNS server url
### Actual result
Exception thrown by player mentioning "No address associated with hostname" leading to playback failure.
### Media
Any media url
### Bug Report
- [ ] You will email the zip file produced by `adb bugreport` to dev.exoplayer@gmail.com after filing this issue.
Contributor guide
Assessment
This issue has not been assessed yet.