wiki:DnsResolution

DNS Resolution

This is a feature for advanced users. The native Mac OS X dns resolver is normally used when looking up ip-addresses for an hostname, but you can specify the list of DNS servers that it should use instead of the native resolver, and the list can be URL-specific just like proxies.

Prerequisite understanding

It is important to understand all about GlimmerBlocker's support for proxies.

When GlimmerBlocker forwards the request to another proxy, it doesn't contact the server directly, and therefore doesn't resolve the hostname. It will be the remove proxy that resolves the hostname. The dynamic DNS resolution is only used when GlimmerBlocker contacts the web-server directly. So it either uses a remove proxy or resolves the hostname.

When GlimmerBlocker resolves hostnames itself, it sends requests to DNS servers using the dnsjava library, so the firewall must not block simple dns lookup UDP packets, or it will fail to resolve.

How it works

You can change the DNS server in the network proxy Javascript (case 3 on the proxy page) and in request modification scripts (case 4).

The DNS server is specified by assigning a comma/semicolon/whitespace separated list of ip numbers to the gb.network.dnsServers variable. Just like gb.network.proxy it is initially empty in the global script, and in request-specific scripts it is initialized to the global value.

Examples

If you want to use OpenDNS when using the University's wireless network, you can use a global proxy script like this:

if (gb.network.interfaces.en1.AirPort.ssid == 'The Great University')
  gb.network.dnsServers = "208.67.222.222 , 208.67.220.220";

If you want to use OpenDNS when resolving URLs for the university, no matter which AirPort network you are connected to, create a rule like this:

Last modified 10 years ago Last modified on 2009-06-06 18:26:45

Attachments (2)

Download all attachments as: .zip