Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Feb 02, 2012 2:13 am 
Offline
Newbie

Joined: Thu Feb 02, 2012 1:47 am
Posts: 3
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?

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


Top
   
 Post subject:
PostPosted: Thu Feb 02, 2012 3:27 am 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
I think in practical terms the answer is no, though it might work in a controlled environment.

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


Top
   
 Post subject:
PostPosted: Thu Feb 02, 2012 12:46 pm 
Offline
Newbie

Joined: Thu Feb 02, 2012 1:47 am
Posts: 3
This isn't for arbitrary access, but I'm trying to avoid a closed network.

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?


Top
   
 Post subject:
PostPosted: Fri Feb 03, 2012 5:05 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
First of all, you would need to configure Apache to listen on both ports 80 and 8080. As for sending the traffic to server2, it could be done as a reverse proxy, redirecting clients with the alias or rewrite modules, or even setting up a firewall rule and avoiding Apache entirely.

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.


Top
   
 Post subject:
PostPosted: Fri Feb 03, 2012 6:06 am 
Offline
Newbie

Joined: Thu Feb 02, 2012 1:47 am
Posts: 3
Thanks. The question was academic. I'm not looking for a solution to anything in particular.


Top
   
 Post subject:
PostPosted: Sat Feb 04, 2012 3:51 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Ah, carry on then. :) Note that the redirections will cause clients to connect directly to server2; the other methods will send all traffic to server1, which then forwards it to server2.


Top
   
PostPosted: Sat Feb 04, 2012 3:55 am 
Offline
Senior Member

Joined: Mon Sep 12, 2011 3:29 am
Posts: 63
ICQ: 1081190
Website: http://kyhwana.org
AOL: kyhwana
Location: New Zealand
linewb wrote:
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.


Top
   
PostPosted: Sat Feb 04, 2012 11:32 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
kyhwana wrote:
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group