iOS Question Find DNS Result - Release App running on iOS or Simulator

BanditMrP

Member
Licensed User
Hi, I have a strange problem.

On both my test iPhones (an iPhone 15, and an iPhone SE 2021) I can resolve an address on an internal network, using the local DNS server to the correct web address using the FQDN. This resolves correctly using an NSLookup App, and using Safari/MS Edge browsers.

When I run my App (Release Build, but with Provisioning Profile) on my phones, I cannot (it seems) resolve the exact same URL.

However, when I use the XCODE Simulator iPhone with the same Release Build I CAN resolve the URL.

So, is there a way in-app to see what IP Address the iPhone (using iHttpUtils2) is resolving the FQDN to, or which DNS server it sent it to???

And any ideas why the same build on the simulator works?
 
Solution
I feel like a right idiot, but maybe this comment will help others.

In a B4X or B4i app:
  • we are able to resolve DNS addresses internally to a local DNS server
  • using a WebView we are able to load a "local" i.e. on the same LAN web site no issues (i.e. https://server01/index.html)
  • using iHttpUtils2 we are able to query a web service
UNLESS - When we first run the App, and it asks for "Allow <appname> to discover devices on the local network" we click "Do Not Allow".

At which point:
  • we are able to resolve DNS addresses internally to a local DNS server
  • using a WebView we are able to load a "local" i.e. on the same LAN web site no issues (i.e. https://server01/index.html)
  • using iHttpUtils2 we are...

BanditMrP

Member
Licensed User
I’ll try it, but as this is an HTTPS enabled site I had dismissed this as not relevant. There are no plain HTTP calls.

I’m on the client site today so will see what happens.
 
Upvote 0

BanditMrP

Member
Licensed User
Alas #ATSEnabled: False made no difference.

The httpjob.success = false and httpjob.errormessage is: (Using iHttpUtils2)

Error Message:
"The Internet connection appears to be offline"

The Internet connection is not offline!

Is there any way to reveal the IP address that the FQDN has been resolved to?

Is there any way to use "Only IPv4" - I'm trying to eliminate things here.

Thanks in advance for any help.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

BanditMrP

Member
Licensed User
I feel like a right idiot, but maybe this comment will help others.

In a B4X or B4i app:
  • we are able to resolve DNS addresses internally to a local DNS server
  • using a WebView we are able to load a "local" i.e. on the same LAN web site no issues (i.e. https://server01/index.html)
  • using iHttpUtils2 we are able to query a web service
UNLESS - When we first run the App, and it asks for "Allow <appname> to discover devices on the local network" we click "Do Not Allow".

At which point:
  • we are able to resolve DNS addresses internally to a local DNS server
  • using a WebView we are able to load a "local" i.e. on the same LAN web site no issues (i.e. https://server01/index.html)
  • using iHttpUtils2 we are NOT ABLE to query a web service (at least in my case!)
The solution to my ongoing problems with a B4X App not working when locally on-site sitting literally next to the server is that I habitually click "Do Not Allow" when asked if I want to allow an App to be able to find devices on the local network.

If ever there was time for a Homer Simpson "DOH!" this is it.

Thank you @Erel for your help with IP Address resolution etc., but the overall result is "It was me!" :oops:
 
Upvote 0
Solution
Top