The following worked for me when I had some of the problems with OS 10.5.8's firewall, internet connection problems, etc. discussed in this thread, after I accidentally unplugged my Mirrored Drive Doors G4. It's mostly a detailed explanation of how to perform some of the suggestions posted here earlier, particularly what user lstnmysphr suggested here about replacing the com.apple.alf.plist file with a backup:
Run the latest Combo updater appropriate for whichever version of OS X you're running.
Open whichever prefpane (depending on the version of OS X you're running) that contains the firewall settings tab (in OS 10.5 and later, it's in the Security prefpane; in earlier systems, it's in the Sharing prefpane). Select the firewall tab's option to allow all incoming connections, then close this prefpane and open the Network prefpane. Select its button to renew the DHCP lease. Close the Network prefpane, then open the firewall tab again, and change the setting to whatever you had it at before ("set access for specific services and applications", etc.), then close the firewall tab's associated prefpane. This works permanently for some people, but only temporarily for others, until the next restart.
If that doesn't help, or doesn't remain permanent, open the firewall tab, write down the names of all the items you selected to allow incoming connections, then close the prefpane, and drag out the plist file com.apple.alf.plist, at /Library/Preferences, to some holding location like the Desktop (in case you need it again), then place a backup copy at /Library/Preferences, using the system's backup copy that's at /usr/libexec/ApplicationFirewall. (OS X normally replaces the active copy of com.apple.alf.plist at /Library/Preferences if you just trash it, but some people taking this approach find the com.apple.alf.plist file that the system recreates no longer fixes the problem at next restart, so it's best to replace it from the backup.) Restart the Mac. If you wish, add back the whitelisted items you wrote down, but it might be best to add them one at a time, and restart the Mac each time, to see if any of them cause the trouble you were originally seeing. The first time you open the firewall tab after replacing com.apple.alf.plist, it won't contain anything except a single entry for Printer Sharing, but as you allow items to accept incoming connections, more items will get added here (mainly to the plist file's "applications" section, visible using something like Property List Editor, or even just TextEdit). This plist file already contains the items mdns, configd, mDNSResponder, and many other things, but they don't appear in the firewall tab (contrary to what some people think) unless you specifically add them, which may be redundant. Though you can manually add these items to see them in the firewall whitelist, this is usually unneccessary--I think the better way to get these items working again, is to replace the com.apple.alf.plist file. After doing this, you may no longer see entries (or may see fewer entries) in the Console logs about mDNSResponder, configd, etc. being denied ("Deny configd data in from 192.168.1.1:67 uid = 0 proto=17"), unless something else is wrong. However, seeing these "deny data" messages in the logs may not automatically mean there's a problem with these.