another spoof domain

Spoof Domains
step by step..

(apply brakes here)

I was about to create a new spoof virtual domain for my LAN, and it occurred to me.. "I should write down the steps I take, save someone else doing it, save time".

So, here goes..

1: Create the fake host..

Every machine you wish to fool, needs to have host entry for your spoofy domain. Let's call this spoof domain "arc". The host file entry would simply be..  arc

See here for details of how to add hosts to your particular machine.

I have one central hosts file that I import into all the different machines. I find this easier to maintain. A local DNS server is another option (or, as suggested by Druid; add the entry to your local nameserver's hosts file, if you have one).

Typing arc into any local browser will now point the it to the Apache server, which will completely ignore the request, until we..

2: Create a virtual host in apache config..

I keep mine in a vhosts.conf file, right next to the httpd.conf (I use an include statement to pull the directives in). The "arc" entry goes something like this..

	<VirtualHost *>
	  ServerName  arc
	  DocumentRoot  "W:/tech/dev"
	  DirectoryIndex  index.html index.php
	  ServerSignature  Email
Note the aliases, (handy for testing rewrite rules and such). You can add as many aliases as you like, so long as you also create corresponding host entries for each (step 1). Also note, this entry is for a Windows® Apache server; I figured it was about time to do a Windows-orientated article. Really, only the DocumentRoot directive is different.

3: Restart apache..

Sadly I don't have the "corzweescriptpack" for windows, although I do have a righteous /unix subtree on my windows box! Aye, I mean emacs, tcsh, ls, tar, the works! That's right! I do ls to get directory listings on my peecee! Oh Joy of UNIX!

However, Apache for windows comes with a whole host of useful shortcuts, so restarting's a breeze; apache also installs as a system service, handy. On UNIX/Linux, your usual apachectl command will be fine. On Mac OS X, use corzweescriptpack! .. ra

We're done!

This is what we get typing arc into a web browser now..

fancy index of arc spoof domain



Welcome to the comments facility!

previous comments (three pages)   show all comments

Ja - 12.07.05 2:32 pm

Alright, it works smiley for :D I found the hosts and lmhosts file and added that simple line to it, and now I type http://jabirdcms/ instead of a big 'ol IP...

Thanks alot, might I ask how you figured all this out?

cor - 13.07.05 3:14 am

w00h00! yeah, it's easy when you know how.

And how did I figure all this out? well, it was the next logical step from this and this. What's good for the Goose.. smiley for :D

I'm glad it all worked out,
you won't be able to go back to raw IP's now!

;o) Cor

druid - 08.08.05 8:26 pm

If you own the server that connects the lan to the internet then probably you also host a nameserver that forward queries to the internet... so you could just add the hosts in /etc/hosts on the server and it would work automagically, without changing anything on workstations... if they have your server as the nameserver of course :)

Joe - 05.10.05 10:58 pm

I followed the instructions explicitly, even creating a seperate vhosts.conf file and still had no success. Running a WinXP SP2 700 with the easyPHP Apache install, the system refuses to find anything but my primary dyndns host. I do recall having had at one time three (yes three!) dyndns domains running out of apache but can't recall how I did it or what version of Apache it was, and I did not make a back up of it. :(

As for AmpSig, it rocks! It has a new place of honor on my site and I will be promoting it on my YahooGroups as well!!!


cor - 06.10.05 2:14 am

hey! I'm glad you like it Joe, feel free to promote it wherever you like, a task I'll need to get stuck into myself sometime soon! smiley for :lol:

As for the virtual hosts, there are many things that can interfere. Before you consider your dyndns, get this working 100% locally. If you hack the addresses into your local hosts file (or local DNS server's hosts file, yup, good call, druid) you can test test test to your heart's content before "going live". At least you'll get a better feel for exactly where the trouble lies.

If apache is serving up the hosts locally (spoofed to, or wherever the server is) then the trouble is upstream. Often folks go messing around with their apache setup when the trouble is elsewhere, and after that it's really screwed!

Backup everything! Always! Make a script! There's nothing worse than having to start from scratch, especially stuff you've already done. Even ancient apache configs can be invaluable setting up a new server. And a zip of a million httpd.conf files would probably fit on a floppy, whatever they are.

Your first virtual host is your catch-all, for a home server, this is probably best left as a dummy, my own virtual hosts file starts something like this..
NameVirtualHost *

<VirtualHost *>
ServerName *
DocumentRoot "/home/null"
DirectoryIndex index.html index.php
ServerSignature off

<VirtualHost *>
ServerName itest
ServerAlias test etest 
DocumentRoot "/home/itest"
DirectoryIndex index.html index.php
ServerSignature off
my "real" hosts come later on. Accessing my web server via the raw URL gets you straight into 403 City (you can actually use /dev/null on a nix system!).

I like to drop this tip in wherever possible because so many avid torrenteers, p2p'ers and what-not go mindlessly about setting up web servers and not considering these things and others. But it's a probably a good tip for anyone setting up a home server, regardless of their other online activities.

If you check out the voyager 205 pages here onsite (google or corzoogle for voyager 205) there's some excellent information on troubleshooting webserver problems, might be of use, and isn't directly accessible from this part of the site, in fact, any part of the site, though somehow the comments file for its main page definitley would not fit on a floppy!

I'm rambling, being in the mood for writing. Anyways, take a methodical approach and you'll crack it. Feel free to get back here with with fun, info, whatever, even mail me your httpd.conf file, I always enjoy those in my inbox, especially when they contain obvious gotchas and bloopers, which they usually don't.

for now..

;o) Cor

Joe - 06.10.05 2:44 am

I just had a thought. (no comments from the peanut gallery please!) When I ran this previously, I didn't install PHP as part of the package. I ran it seperate from Apache. I can back up my site, uninstall the EasyPHP and reinstall plain old vanilla Apache no frills no bells no whistles. If it works then I know it's the installation and maybe I can grab the http.conf from it and reinstall smiley for :geek:

One more plug for anyone running their own server and

Everything Cor ever warned you about on running a site

cor - 07.10.05 3:56 pm

yup, these days I can't be bothered with these "easy" methods, they usually end up more difficult in the long run. Vanilla php and apache aren't so vanilla any more, come with a host of useful things, as well as decent installers.

Of course, you end up learning more about how things actually work, too. Have fun!

;o) Cor

Joe - 10.10.05 4:48 am

Arrgh! No luck that way either. Any ideas from the files I sent in email?

smiley for :erm:

Joe - 16.10.05 6:24 am

smiley for :idea:

I got it rofl I knew there was a way to do it. I printed it out this time so I will have it next time but I'm not sure why it didn't work when I tried it earlier.

I did it using only the vhosts.conf since I'm not comfortable editing the lmhosts file. My vhosts.conf is listed below:


<VirtualHost 12.345.67.8901>
DocumentRoot w:/www/
DirectoryIndex index.html index.shtml index.php
ErrorLog logs/virtual-error_log
CustomLog logs/virtual-access_log common

Obviously the sections are edited but you get the idea. Thanks for all the help Cor, and if you need a beta tester for the new Corzblog, let me know. I'll be happy to beat it through its paces.


cor - 17.10.05 7:17 pm

email? smiley for :eek:

Hey! well, it's working, that's the main thing. I must have missed your last comment in the crazy comment thing upgrade last week ("that comment thing" being the thing that provides comments at the foot of the pages - and "crazy" being me running all those recursive awk programs on the live comment files themselves! hahah) I haven't rummaged through my spam folder in weeks, I do put it off some, but I would have had rummaged if I'd spotted this comment, cuz I like emails with attachments! smiley for :D

Thanks for the offer, corzblog III isn't quite ready for the big-time yet, but at least it is now 100% xhtml compliant and produces quite nice code, too (and check out my new 100% css roll-over archives menu! *ahem*). cbparser, the bbcode parser, is about to get a beta release any day, after I let the commenteers play with it for a bit. (my unwitting beta-testers!)

I invariably use a wildcard for the NameVirtualHost directive, because there's usually umpteen hosts coming off the one box, but whatever works for you, sounds great.

;o) Cor

ps.. I keep all my spoofy domain information in a separate file called simply "myhosts" (which is shared with other boxes). In your network properties you can import a hosts file, and Windows® will run checks on it before adding the individual hosts. This is a safe approach until you feel comfortable editing the file directly.

Deikliw - 01.11.05 4:04 pm

Hi there
most impressed with your work on hacking the voyager 205. My issue is i want to view web space in my wwwroot folder (iis) from the Internet (through router) other than just being able to view this on an intranet basis ("foldername"/index.htm).

I have tried to follow your examples many times to no avail and feel I am getting confused to all the settings needed.

I am also aware you may recieve many requests on the things already covered in your tutorials but I can only ask. please help


next comments (1 page)

Posting is currently disabled. Come back later!

Welcome to!

If something isn't working, I'm probably improving it, try again in a minute. If it's still not working, please mail me!