It's probably easier to get them from /etc/resolv.conf instead.
Originally Posted by
/etc/dnsmasq.conf points to /var/run/resolv.conf, /var/run/resolv.conf.wlan0 and so on for each adapter, but these files don't exist
They should be created by the udhcpc script (somewhere under /etc/udhcpc) automatically whenever a connection is established, assuming the DHCP server actually provided DNS configuration.
/etc/dnsmasq.conf points to /var/run/resolv.conf, /var/run/resolv.conf.wlan0 and so on for each adapter, but these files don't exist
Strange, /var/run/resolv.conf.wlan0 exists when I'm on wireless, and /var/run/resolv.conf.gprs is there when I'm connected via GPRS. Did you actually look when the connection was active?