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.. 192.168.1.100 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 ServerAlias arc.com arc.org ServerAdmin corz@corzoogle.com DocumentRoot "W:/tech/dev" DirectoryIndex index.html index.php ServerSignature Email </VirtualHost>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 dols
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..En-joy!
;o) corz.org
Welcome to the comments facility!
you'd be easier simply accessing the site via a japanese proxy
google for "proxy servers"
;o)
Thank you SO much. I can't believe it was that easy! ^_^
way to go! saved me hours!!!
hello! can u help us on spoofy domains..its r project..i cannot find the wins in network connection.
wicked ,many thanks fer the info
cool, a pleasure.
sorree anonymous, musta missed this one, been busy over at the router area, creates a lot of noise in the "comments" section of my admin page!
feel free to drop in again (but use a name and email!), or mail me if you still need help.
;o)
The windows hosts file is stored in the fowling location for thoes who need it
C:\WINDOWS\system32\drivers\etc theres a file in there called hosts it works the same way
Indeed, you can use either the "hosts" or the "lmhosts" file to insert your local domain names. I use "lmhosts" because a) it allows more configuration options and b) and this is just a hunch; it's read first.
"lm" is for Lan Manager, so primarily the lmhosts file is for NETBIOS name resolution. So it would make sense to query this before the regular hosts file. But the mappings cover everything, you can use "desktop" to connect over LanManager (samba shares) as well as http/ftp/ssh/ttelnet, whatever. Once they are cached (or better still, preloaded), there's no delay when accessing the hosts themselves.
Both will work, but you can't
#pre
load hostnames in a regular hosts file, amongst other things. I'd also noticed that the "hostess" application for Windows uses the "lmhosts" file.Whichever you use, the difference is probably only miliseconds, anyway.
;o)
hey, I have a dyndns domain name pointing to a my local webserver. All is well when you connect from outside the LAN with www.mydyndns.net, but when I try that from my LAN i get redirected to my router config at 192.168.1.1... I know I can get to my web server locally with the local IP but I'm trying to serve a web page that needs to have www.mydyndns.net/filename as a php include and I want it to work internally and externally. Any ideas or did I just confuse the hell out of you? Thanks!
nope, that makes perfect sense, it's a topic I cover often over in my voyager router area. The answer, well documented here, is to use a proxy.
TADA!
As to the php include, you don't need to specify an exact domain, just grab it from the server, either from the filesystem, or use the HTTP_HOST server variable for your statement, something like..
include($_SERVER['DOCUMENT_ROOT'].'/inc/comments.php');
(filesystem) or (by domain) ..
include('http://'.$_SERVER['HTTP_HOST'].'/inc/comments.php');
and let php work out all that messy dns stuff!
;o)
ps.. hard-coding domain names into a php script is a definite no-no! 0/10 for portability!
Hello,
I have a WinXP SP2 machine running Apache 2.0.53. I named it xyro instead of arc. I performed those tasks but it says "connection refused".
Please mail be back with the solution.
Thanks in advance.