This may sound like a very silly question, but how could I setup domains ( eg www.foo.com ) on my local network? I know that all a domain is, is just a name registered to a name server and that nameserver has a zone record, and in the zone record there are several records of which the A Record
is the most important in dictating where the lookup goes to, which machine it should point to.
I basically want to make it so that I can refer to my other computer/webserver as 'www.foo.com' and make my local sites accessible by that, mess with virtualhost records in Apache and zone records for the domain except locally so I can explore and fiddle around and learn instead of having to rely on the domains I own on a public registrar that I could only access through the internet.
Once again I apologize if this is a silly question, or if I'm completely thinking backwards.
Background information: My OS is Debian, I'm a novice at Linux. I've done very small edits in zone records on a Bind9 Server but that's the extent of my networking experience.
I think what you want to do is edit your local machine's hosts file (
/etc/hosts
on most Unices, something underwindows32
or whatever on Windows boxes) to pointwww.foo.com
or whatever to your local machine or any other local IP address you want to use.I'd agree with Womble's answer for most cases. Your comment to his answer, though, mentions simulating mail delivery for that domain. Entries in the "HOSTS" file act the same way as "A" records in DNS. If you need to "simulate" MX, SRV, or other types of records, though, you are going to have to setup a DNS server.
You can create zones for the domains you want to "simulate" in your BIND server. All the computers that use your DNS server will resolve the names in whatever domains you choose to make your server authoritative for however you configure them. Heh heh...
I quite like having an internal DNS server on the LAN. I enjoy creating zones for domains like "doubleclick.net" and putting in wildcard records that refer to an IP address of a web server on the LAN to return 404 errors in place of their ads.