Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Configure DNS lookups from the terminal Network
There's a lot of conflicting information about how to set networking information (such as DNS resolution configuration) from the terminal. In the course of setting up a VPN package (openvpn) on OS X, I had to set the DNS resolution configuration dynamically from a shell script.

As of (at least) 10.3, /etc/resolv.conf (or /var/run/resolv.conf) is NOT the place to do this. Re-writing /etc/resolv.conf resulted in a system where a DNS lookup with host would work, but dig and ping would not. Sometimes /etc/resolv.conf would be magically restored to its original configuration. I thought the smarter option would be in the NetInfo database, except on my machine, I had no resolver configuration hiding there.
,br> The answer? OS X has a daemon called configd, which magically collects configuration information, sends notifications, and maintains a dynamic database of the current settings. The host command would read my hacked-up /etc/resolv.conf, but smarter DNS lookups would query the network configuration database from configd.

The command-line tools to interface with the configuration daemon are scselect and scutil. scselect provides a list of defined network locations (as in the Network preference pane) and allows you to choose between them. scutil enables much more fine-grained control over the current network configuration. Unfortunately, it only really offers a command-line interface to modify the configuration database. To use scutil from a bash script, you must dynamically create an scutil script as a text file, and pipe it to scutil.
read more (208 words)   Post a comment  •  Comments (13)  
  • Currently 2.86 / 5
  You rated: 2 / 5 (7 votes cast)
[92,183 views]  View Printable Version
10.4: Disable Connect to Server clear text warning Network
Tiger only hintThe main idea behind this hint would be to run servers that accept secure encrypted logins, but if you are not in the position to change the server environment, and have hundreds of Macs that you wish to disable the Connect to Server clear text warning on, this hint should work as expected. Use Apple Remote Deskto or other methods for multiple machines -- it's the 'getting around the UI' bit that counts in this case.

I believe this also serves to detail the proper way to edit nested dict keys using defaults write (man defaults in if you have further interest). Here's the long (one-line!) command:
defaults write NSGlobalDomain -dict \
afp_active_timeout -int 0 afp_authtype_show -bool false \
afp_cleartext_allow -bool true afp_cleartext_warn -bool false \
afp_debug_level -int 6 afp_debug_syslog -bool true afp_default_name \
"" afp_idle_timeout -int 0 afp_keychain_add -bool false \
afp_keychain_search -bool true afp_login_displayGreeting -bool true \
afp_mount_defaultFlags -int 0 afp_prefs_version -int 1 \
afp_reconnect_allow -bool true afp_reconnect_interval -int 10 \
afp_reconnect_retries -int 12 afp_ssh_allow -bool false \
afp_ssh_force -bool false afp_ssh_require -bool false \
afp_ssh_warn -bool true afp_use_default_name -bool false \
afp_use_short_name -bool false afp_voldlog_skipIfOnly -bool false \
afp_wan_quantum -int 0 afp_wan_threshold -int 0
[robg adds: I have not tested this one...]
  Post a comment  •  Comments (1)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
[9,078 views]  View Printable Version
Fix a phantom Connect to Server problem Network
Clicking on the Startup Drive, a folder, or trying to empty the trash brings up a Connect to Server... dialog, sometimes with nothing but a gray background. The Spinning Rainbow Ball spins and spins, but whatever you clicked on does not open up (or in the case of the Trash, does not empty).

Interestingly, I found that I could run any program that was in the Dock, including making email connections and internet connections. I believe this is because the three actions that it would not do involve accessing the LAN due to the sidebar at the left of the window (in the case of folders), and checking network trashes (in the case of emptying the trash).

  1. Disconnect your network cable & reboot.
  2. Throw out aliases in the Recent Servers folder.
  3. Go to your Keychain Access (in the Utilities folder) and toss out all references to the phantom server.
  4. Go to Connect to Server... (Command+K) and remove any references to the phantom server there.
  5. Plug your network cable back in and reboot your computer.
  6. Go to Connect to Server... (Command+K).
  7. Now connect to a server that you know is there.
  8. When that server comes up, click on your own drive in the Task Bar at left. It should open now. All other folder functions should now be restored as well.
What Didn't Work:
  • Rebooting
  • Zapping the PRAM
  • Booting into single user mode (Command+S at startup) and running a file system check (/sbin/fsck -fy)
  • Running Norton (although it did "fix major errors")
  • Booting off installer CD and fixing permissions (using Disk Utility)
I hope that this has been helpful, and that it saves you some of the time and heartache it took me to fix the same problem -- this happened on three of our Mac workstations in one week. You can also download an illustrated version of this hint if you wish...
  Post a comment  •  Comments (4)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
[7,977 views]  View Printable Version
10.4: Reclaim 'Automatic' AirPort network selection Network
Tiger only hintFor those of us (foolhardily?) brave enough to upgrade to Tiger via Archive & Install, one of the annoying consequences can be the inability to select anything other than "A specific network" in the Network settings panel to join by default. The new "Preferred Networks" setting is also AWOL. (Another annoying consequence of an Archive & Install: Volume Logic doesn't move to the new installation ... drat!)

While this hint discusses general tips for cleaning out the Airport known/preferred network list, the solution for this problem is much simpler: delete and recreate the network locations that use Airport (Location menu -> Edit Locations... -> Delete). Voila! The Automatic & Preferred Network choices now show up.
  Post a comment  •  Comments (6)  
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
[18,416 views]  View Printable Version
Set no default route for VPN Client via PPTP/L2TP Network
It seems to be a common problem that, when connecting with Mac OS X VPN client to a VPN server, you end up with getting a default route to that server. But in some cases, you'll still want to use your original internet connection by default, and only have the routes for the remote VPN pointing to the VPN server.

I found some solutions on the net (most of them involved making a wrapper around pppd or hacking some of the system scripts), but they are neither a proper nor one-size-fits-all solution. The right way to do it is as simple as this... Put the keyword nodefaultrouter into the file /etc/ppp/peers/your-vpn-name. Then create a script called /etc/ppp/ip-up with the following contents:
route add -interface ppp0
Replace with the network address of your VPN. I hope this helps.

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (5)  
  • Currently 3.43 / 5
  You rated: 5 / 5 (7 votes cast)
[37,074 views]  View Printable Version
10.4: A fix for the Cisco VPN Client 4.6.03 Network
Tiger only hintAfter digging around on the Internet for quite some time, I came across this hint on a German website. I used an online translation site to translate the text to a rough English version. Wish Cisco could be as helpful as the Germans...

You will need to use the Terminal to perform this modification. What you need to do is replace the cvpnd file in /opt/cisco-vpnclient/bin with an extracted version from the installer disk image. Once you have replaced the cvpnd file, you should verify the proper permissions have been set on the file once it has been replaced. Here is a cleaned up version for your digestion.
read more (221 words)   Post a comment  •  Comments (18)  
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
[22,602 views]  View Printable Version
10.4: Fix a CUPS remote printing problem Network
Tiger only hintAfter upgrading to Tiger (fresh install), I could no longer use my TiBook to print over the network to my Samsung ML-1710 laser printer, which is connected via USB to my linux server "beigeg3" (running CUPS) in my home office. Even worse, once the network printer was selected in the Tiger print dialog, I couldn't do any kind of printing task -- not even Save to PDF for transferring to the linux server. All attempts ended with the unhelpful error message "Error while printing". I haven't been able to find any reference to this problem on the net, but the fix is so simple, I think it's worth sharing.

Using the CUPS http interface (http://localhost:631) to try to print test pages gave me useful error messages: apparently Tiger reported the Linux server hostname to cups as "beigeg3," but CUPS didn't know where to find that host (no DNS server runs on the LAN). Adding this line:    beigeg3
to the /etc/hosts file on the TiBook let CUPS know where to look fixed the problem. Of course you'd want to use the IP address and name of your own print server there. This seems like a bug to me (shouldn't CUPS be able to access NetInfo to get this address?).
  Post a comment  •  Comments (7)  
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
[16,013 views]  View Printable Version
10.4: Avoid a 10.3/10.4 file sharing bug Network
Tiger only hintHere's a workaround for a somewhat obscure file sharing bug. If you have an external drive on a Panther machine you are sharing, do NOT check the Ignore Ownership box in the Get Info window. If you do, there is a bug in the Tiger client such that it can no longer write to that drive -- reading is fine.

I called Apple's tech support and was able to get their tech to reproduce the problem. He seemed quite surprised that this was such a simple bug to reproduce. I have not confirmed if this problem occurs when sharing drives between Tiger and Tiger.

I turned this checkbox on as I have a very simple network and want people to read/write anywhere on this drive and not get ownership headaches. Unix in a nice OS, but its file permissions, while very powerful, are not well suited for a home network where security is a very low priority.

[robg adds: I can't confirm this one, as I no longer have a Panther machine available. But it's apparently been verified by Apple, so hopefully, a fix is coming soon...]
  Post a comment  •  Comments (4)  
  • Currently 4.00 / 5
  You rated: 5 / 5 (4 votes cast)
[7,692 views]  View Printable Version
How to stream audio and video to a mobile phone Network
If any of you are interested in streaming your own video or audio handywork over the internet to your cell phone (be it a 2.5G phone or 3G phone), I've put together a little site with all you need to know. It's aimed at education, but there is nothing stopping you having a go yourself at home, if your Mac can be seen by the outside world -- that is, your home computer has an outside IP address on a broadband connection.
  1. You would need to download and install the binary version of the Darwin Streaming Server (DSS). It's open source, so no cost. After installing, then test out to make sure it's working. The Darwin Streaming Server Admin Guide is a great document.
  2. To convert your video or audio content out of Apple's iLife applications or QuickTime Pro and Final Cut Pro/Express, have a look at my tutorials.
  3. After your file has been converted to a 3GP file, then place it in onto your Darwin Streaming Server (more info).
  4. To then view it on your phone, make sure that you have internet access on it. Then enter the address of your server on your phone eg. rtsp://my-server/my-file.3gp.
  5. To make life easy for you and to browse your content, I suggest you use iWapper to create your WAP site on your .Mac site.
To have a look at my site on your phone:

[robg adds: I haven't tested any of this...]
  Post a comment  •  Comments (4)  
  • Currently 3.00 / 5
  You rated: 5 / 5 (6 votes cast)
[29,002 views]  View Printable Version
10.4: Move saved searches to the iDisk Network
Tiger only hintI kind of stumbled accross this by accident. You can move your Saved Searches folders from the directory ~/Library/Saved Searches to your Desktop (which I think is pretty obvious); but I hadn't really thought about dragging them to my iDisk ... but you can.

Of course, you're only synching the query terms from the .savedsearch file that is the "smart folder," but the nice part is that complicated queries dont't have to re-created repeatedly (along with all the usual benefits of synchronization).
  Post a comment  •  Comments (1)  
  • Currently 2.25 / 5
  You rated: 3 / 5 (4 votes cast)
[3,914 views]  View Printable Version