Software Quality

March 6, 2015

Mobile Testing of websites with DNS Entries that are not yet public

Filed under: Uncategorized — David Allen @ 7:27 pm

Problem:

You have a new website, but it uses a URL entry that is not yet public, or it is public, but it points to a different IP than the one that will be there when you go live.  Yet you MUST test the site using the exact host name. What do we do?

On the desktop, this was easy

On a Windows desktop, you simply edit the hosts file located in C:\Windows\System32\drivers\etc

These solutions were easy for me to find and are well known.

On an iPhone, it is trickier.

I read about some jailbreak options equivalent to the desktop “hosts” file option, but I did not want to go down that path.

So, I created a DNS server. In my case, I installed DNS services on a Windows Server 2012 machine, but there are lots of ways to get a private DNS server including Linux with Bind. Then I entered a DNS entry for my custom URL-to-IP mapping.

Then I overrode the DNS entry in my wifi setting on my iPhone 6 Plus to specify my custom DNS server. That was good enough for Safari and Perfect Browser. But Chrome seemed to ignore that and had its own set of DNS entries. I could NOT figure out where they came from. I thought maybe it had magic powers and was programmed to go to Google’s DNS servers as a backup, or something like that.

Then I found this article, http://superuser.com/questions/203674/how-to-clear-flush-the-dns-cache-in-google-chrome/886595#886595. and I did what they described:

1. Navigate to chrome://net-internals/#dns and click “Clear Host Cache”
2. Navigate to chrome://net-internals/#sockets abd click “Flush Socket Pools”

AND I had to also Use an InCognito Tab as mentioned above.

Only THEN did Chrome use my custom DNS entry.

I had no Idea Chrome had its own internal DNS cache.

1 Comment »

  1. Most of the browsers do I think. I’ve had it where you do flushdns on the command line but IE would hold onto a previously resolved hostname. Usually that was easily fixed by restarting the browser. I like your solution of using a private DNS server though. That’s a good way to get the device on your LAN.

    Comment by Uriah Blatherwick — March 6, 2015 @ 10:05 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: