Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-14-2008, 01:33 PM   #1
LQ Newbie
Registered: Apr 2008
Posts: 5

Rep: Reputation: 0
hosts conf. file - how to enable subdomains for testing?

I notice that I can add different hostnames to point to localhost or different IP's in my /etc/hosts file. For example I can add:
Quote: somename
and I can set up virtual hosts to apache and work on different sites, without them being in the same document root folder and subfolders. Is there a way I can make subdomains work with this?
for example if I go to http://subdomain.somename and it would still work? for now only hostname without subdomains work. Any suggestions? Thanks!
Old 06-14-2008, 11:48 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
The hosts file will support this.

It's actually meant to take it in this format:

IP      hostname.domainname hostname
So you could easily put in a subdomain.

Code: mydomain


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
virtual hosts subdomains zenerdiode Linux - Server 5 04-30-2007 12:29 PM
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 09:21 AM
Subdomains on Apache2 with virtual hosts - how? <Ol>Origy Linux - Networking 2 08-18-2005 05:53 AM
/etc/hosts, /etc/resolve.conf and /etc/host.conf config probs below_average Linux - Networking 1 12-08-2004 10:07 PM
enable changes to /etc/hosts without reboot? vrillusions Linux - Networking 4 05-17-2004 09:42 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:01 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration