X

Safari takes two attempts to connect to some sites, possible solution

Safari takes two attempts to connect to some sites, possible solution

CNET staff
2 min read

For some users, certain sites will refuse to open in Safari unless requested multiple times. In most cases, the issue resolves after one or two attempts, but in others Safari displays the "Cannot connect to server message" several times in a row.

MacFixIt reader Phil writes:

"On or about the time of installing the OS 10.3.4 update, or perhaps a security patch (though I have yet to do the 6/7 patch), Safari has started to act up. 10 times a day I will get the 'Safari cannot connect to the server' drop down box, even though I'm trying to connect to sites which are always up and available - like MacFixIt, News.com, MyNetscape, Google, Apple, MacCentral, and others. This happens when I click on links on pages, tool bar bookmarks, and when I start Safari or open a new window. After clicking 'ok' on the drop down prompt I place the cursor in the address bar and hit 'enter' and the page loads normally."

"I've also repaired permissions, run Norton Util's, Panther Cache Cleaner and everything else I can think of. My OS installation is from a complete wipe straight to 10.3.3, now updated to 10.3.4 on a 600 MHz iBook with max RAM. "

Apple Knowledge Base article #151266 offers a number of potential culprits for this issue, as well as corresponding solutions, including:

  • Safari may not be able to open a webpage because it doesn't recognize the first part of the address, which identifies the Internet protocol (such as HTTP or HTTPS).
  • Try entering "/index.html" at the end of the address.
  • Empty the cache, then try reloading the page.

For many readers, however, none of the Apple-supplied solutions work to resolve the issue.

A poster to Apple's Discussion boards, Freelancer, has found that creating a enabling a local DNS server and modifying the query command in the file "named.conf" eliminates the issue on his, and a number of other users' systems.

Instructions for performing the procedure, provided you are comfortable using a text editor like Pico, (the Mac Observer has a good introductory article on using Pico if you are unfamiliar) are as follows:

1) the file /etc/hostconfig needs to have one line modified

DNSSERVER=-NO-

becomes

DNSSERVER=-YES-

2) the file /etc/named.conf needs changing at one line as follows (Ed.- note that you should first make a backup copy of this file with the command: sudo cp named.conf.copy then edit the original with pico via the command sudo pico named.conf.

// query-source address * port 53;

becomes

query-source address * port 53;

it is uncommented

3) Start the server in Terminal with this command:

sudo /usr/sbin/named

Give your administrator password when requested

4) Under Network Preferences -> TCP/IP -> DNS Servers, make the first listed server:

127.0.0.1

"If you have other DNS Servers listed already, you can leave them there as backups. Apply the change and you are good to go.

Feedback? Late-breakers@macfixit.com.

Resources

  • #151266
  • Freelancer
  • Pico
  • introductory article
  • Late-breakers@macfixit.co...
  • More from Late-Breakers