subdomain.xxx.xxx.xxx.xxx possible?
I'm not sure if what I'm trying to do is even possible.
Can I have a subdomain to a non-namebased ip address like this:
subdomain.74.125.224.243?
Since the apache docs don't have an example of this, I'm assuming it can not be done, but my DNS-fu is weak.
Im thinking that it is probably NOT possible, because the word sub-DOMAIN sort of infers the presence of a domain, but I've been Googling this all night and as you can imagine every search result regarding sub-domains relates to name-based virtual hosting - all 17 million of them.
Thanks
7 Replies
Technically something like name.#.#.#.# is valid in terms of a domain name (where each label can be letters, digits or a hyphen/dash), but there would be no way to resolve it in DNS. And unlike using an actual #.#.#.# address, it won't be recognized as an address (which is how #.#.#.# works in applications - they actually bypass DNS and just parse the string into an address).
I haven't tried it, but don't see why you couldn't configure Apache (or any web server) with a virtual host using such a name, and assuming the address lookup would work the client would just put the name in the Server: header like any other domain.
If you controlled all the clients you could add the appropriate name to the local hosts files, or you could point the client resolvers to a private DNS server to resolve the names, but it would only work in your controlled environment.
But if you're trying to support this for arbitrary users connecting to your service, I think it's probably a non-starter.
– David
Thanks
In a somewhat related question:
mydomain.com -> server1
mydomain.com:8080 -> server2 (different physical machine)
Would the above be accomplished by simply sending all requests to server1 and then using a vhost directive to forward traffic on port 8080 to server2's IP?
listen onreverse proxyaliasrewrite
But I have no idea which, if any, of these options you want without knowing what your goal is. What web services are you hosting on each machine? Why is it important for users to access them with certain names? For example, if you're running a blog and a forum on separate machines, probably the simplest and cleanest method is to point blog.example.com at one machine and forum.example.com at the other. But if we don't understand the objective, we can't really offer sensible solutions.
@linewb:
Hello
I'm not sure if what I'm trying to do is even possible.
Can I have a subdomain to a non-namebased ip address like this:
subdomain.74.125.224.243?
Thanks
Nope.
"74.125.224.243" Isn't a domain, so you can't have subdomains. It's just an IP address.
@kyhwana:
Nope.
"74.125.224.243" Isn't a domain, so you can't have subdomains. It's just an IP address.
I'd argue it depends on how an application interprets the string "74.125.224.243" (assuming you're starting with just that sequence of characters).
By domain name standards I believe it's legal as a domain name, and aside from it not existing globally, "243" could be a TLD in a private nameserver. IP addresses already show up in domain names (e.g., 243.224.125.74.in-addr.arpa for reverse lookups).
It's just tricky to get typical applications to treat it that way (since convention is first to try to parse a string as a literal address). Though as I noted in my earlier response, the moment you put an alphanumeric label as the first segment (e.g, the desired "sub-domain"), that check should fail, so applications would be passing the full string back into DNS.
– David