OSX Lion (10.7.5). Network preferences has an option to set up (and order) DNS adresses. My router (Bell Connection Hub - Bell Canda) also has an option for specifying DNS addresses. Which takes precedence in ordinary, vanilla browser requests? In other requests? Are there special situations/considerations? Thanks!
If you specify DNS entries in your router's configuration, then any DHCP client of that router will receive those DNS addresses and perform lookups against them.
If you only specify DNS entries on your own Mac, then your lookup requests will be handled in the order listed.
You might want to consider running the excellent and free namebench to find the best DNS entries for your location and Internet connection.
If you manually enter DNS server(s) in the Network preferences, they'll take precedence over the DHCP-supplied DNS server(s). And I don't mean it'll try the manual DNS server first and if that doesn't work it'll fail over to the DHCP-supplied server, I mean it'll ignore the DHCP-supplied server(s) entirely. There are, however, some complications:
If you have multiple network interfaces ("services") connected (e.g. both Ethernet and Wi-Fi), it'll use the DNS settings from the "primary" service (i.e. the one listed first in the Network preferences sidebar). So if Ethernet is the primary service, and you enter manual DNS servers for the Wi-Fi interface, they'll be ignored in favor of the DNS servers associated with the Ethernet service (but manual DNS server entries on the Ethernet service will override those supplied by the Ethernet DHCP config).
OS X's DNS "resolver" actually consists of a bunch of resolvers for different types of lookups. In addition to the default resolver (configured based on the network settings/DHCP/whatever) there are some built-in resolvers that ignore the regular DNS settings and do something else instead. Mainly, they are for things like names ending in ".local" that get resolved by local multicast lookup (mDNS). So, for example, if you try to connect to "something.local", it won't ask the regular DNS server for the address, it'll send out a "hey, is something.local here? If so, send me your address..." to the local network(s). You can get a full list of these (as well as see exactly what server(s) are being used for regular DNS), with the command
Programs that do their own DNS resolution... will do whatever they please. But mostly we're talking about programs like
host, which are specialized DNS query tools. General-purpose programs (like browsers) should all use the system resolver. (And BTW,
hostall actually look at /etc/resolv.conf, which is set to the same policy as the default resolver, ... so they wind up following mostly the same policy, just without the multicast stuff.)