If you have a webserver within your local network, and want to access it from the inside, if you are using a DG834G ADSL modem, you can't, as the domain name lookup always returns your WAN IP address. For some PCs, it is possible to override this lookup in the local hosts files, but not in everything, for example, the Sony PS3 does not allow you to modify anything, and other devices such as the Android Tablets/Phones and IPads require some detailed hacking. Other reasons for not modifying things locally, is that if you take a laptop from your house, you don't want to keep hacking the hosts file to access the same machine.

There are a few ways to achieve this - firstly, modifying the routing so connections to the internal network actually pass out of and back through the modem - this involves modifying the router configuration.

And secondly, as identified in a previous post, there is a program on the DG834Gv5 called dnsmasq which supports the reading of parameters from the local hosts file, if the -H switch is used.

Problems arise with permanently making any of these changes, because the image is installed on a squashfs filesystem, which is compressed, and cannot be modified. There is little firmware hacking support for the v5 modem, because it is the first one to use the ARM processor. It is, however, possible to extract information from, modify and re-assemble a firmware image.

Key Applications

DNSMasq

This program is used to provide an interface to the DNS system.
Usage: dnsmasq [options]

Valid options are :
-a, --listen-address=ipaddr Specify local address(es) to listen on.
-A, --address=/domain/ipaddr Return ipaddr for all hosts in specified domains.
-b, --bogus-priv Fake reverse lookups for RFC1918 private address ranges.
-B, --bogus-nxdomain=ipaddr Treat ipaddr as NXDOMAIN (defeats Verisign wildcard).
-c, --cache-size=cachesize Specify the size of the cache in entries (defaults to 150).
-C, --conf-file=path Specify configuration file (defaults to /etc/dnsmasq.conf).
-d, --no-daemon Do NOT fork into the background: run in debug mode.
-D, --domain-needed Do NOT forward queries with no domain part.
-e, --selfmx Return self-pointing MX records for local hosts.
-E, --expand-hosts Expand simple names in /etc/hosts with domain-suffix.
-f, --filterwin2k Don't forward spurious DNS requests from Windows hosts.
-F, --dhcp-range=ipaddr,ipaddr,time Enable DHCP in the range given with lease duration.
-g, --group=groupname Change to this group after startup (defaults to dip).
-G, --dhcp-host= Set address or hostname for a specified machine.
-h, --no-hosts Do NOT load /etc/hosts file.
-H, --addn-hosts=path Specify a hosts file to be read in addition to /etc/hosts.
-i, --interface=interface Specify interface(s) to listen on.
-I, --except-interface=int Specify interface(s) NOT to listen on.
-j, --dhcp-userclass=, Map DHCP user class to option set.
-k, --keep-in-foreground Do NOT fork into the background, do NOT run in debug mode.
-l, --dhcp-leasefile=path Specify where to store DHCP leases (defaults to /var/lib/misc/dnsmasq.leases).
-L, --localmx Return MX records for local hosts.
-m, --mx-host=host_name Specify the MX name to reply to.
-M, --dhcp-boot= Specify BOOTP options to DHCP server.
-n, --no-poll Do NOT poll /etc/resolv.conf file, reload only on SIGHUP.
-N, --no-negcache Do NOT cache failed search results.
-o, --strict-order Use nameservers strictly in the order given in /etc/resolv.conf.
-O, --dhcp-option= Set extra options to be set to DHCP clients.
-p, --port=number Specify port to listen for DNS requests on (defaults to 53).
-P, --edns-packet-max= Maximum supported UDP packet size for EDNS.0 (defaults to 1280).
-q, --log-queries Log queries.
-Q, --query-port=number Force the originating port for upstream queries.
-R, --no-resolv Do NOT read resolv.conf.
-r, --resolv-file=path Specify path to resolv.conf (defaults to /etc/resolv.conf).
-S, --server=/domain/ipaddr Specify address(es) of upstream servers with optional domains.
--local=/domain/ Never forward queries to specified domains.
-s, --domain=domain Specify the domain to be assigned in DHCP leases.
-t, --mx-target=host_name Specify the host in an MX reply.
-T, --local-ttl=time Specify time-to-live in seconds for replies from /etc/hosts.
-u, --user=username Change to this user after startup. (defaults to nobody).
-U, --dhcp-vendorclass=, Map DHCP vendor class to option set.
-v, --version Display dnsmasq version and copyright information.
-V, --alias=addr,addr,mask Translate IPv4 addresses from upstream servers.
-w, --help Display this message.
-x, --pid-file=path Specify path of PID file. (defaults to /var/run/dnsmasq.pid).
-X, --dhcp-lease-max=number Specify maximum number of DHCP leases (defaults to 150).
-z, --bind-interfaces Bind only to interfaces in use.
-Z, --read-ethers Read DHCP static host information from /etc/ethers.
Param

This program is used to store and retrieve parameters and configuration options.

usage: param [show [pattern]] [set name=value] [unset name] [save]
Rebuilding a Release