[Dnsmasq-discuss] resolve subdomains / name-based vhosts

/dev/rob0 rob0 at gmx.co.uk
Sun Apr 15 17:18:30 BST 2012

On Sun, Apr 15, 2012 at 05:29:43PM +0200, go4unkwn at hushmail.com wrote:
> the question i have isn't dnsmasq specific, but i hope in this
> forum are a lot of dns cracks (i call me a newbie).
> i hav a dyndns account for my dynamic ip, so that i can reach my
> home lan from the internet. i also have a registered domain.
> futher i can create in my dyndns account cnames for subdomains.

"Hostnames", not "subdomains." Subdomain implies delegation to 
another authority. For example, the "uk." domain delegates to 
"org.uk." which in turn delegates to "thekelleys.org.uk."

> examples:
> - - foo1.mydomain.org

You probably don't own mydomain.org. Please don't use real domain 
names as examples. We have example.org (and others) for that.

> - - foo2.mydomain.org
> - - foo2.mydomain.org
> what i have in mind is to run an apache2 server using name-based
> vhosts for a school. example:
> - - foo1.mydomain.org
> - - foo2.mydomain.org
> - - foo3.mydomain.org
> now my question is, when a studend uses for example
> foo1.mydomain.org in his browser, could the browser find my name-
> based vhost (all vhost are behind the same router (wan-ip), or do i
> have to configure for each vhost a different port.

It seems like one thing you are not understanding is the concept of 
HTTP virtual hosts. All you have to do in dnsmasq is to list each 
name with that IP address in /etc/hosts(5):	foo1.example.edu	foo2.example.edu	foo3.example.edu

> the router runs dnsmasq. does dnsmasq have to find out which
> subdomain leads to the wan-ip? or is there another possibility to
> find out, which subdomain leads to the wan-ip?

The WAN IP address has nothing to do with this. The whole point of 
dnsmasq is to have the external names resolve to internal addresses.
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:

More information about the Dnsmasq-discuss mailing list