Most APs provide DNS server IPs with DCHP. Not all apparently open APs are open and may require a login or have implemented a technique like MAC blocking which without hacking on your part keep you out.