Page 1 of 1

Intranet domain names

Posted: Sat Feb 21, 2009 2:40 pm
by alex.barylski
EDIT | Sounds like my Linux server needs to be configured with DNS and DHCP (requiring me to disable my router DHCP) and the Linux server then acts as a gateway for the other work stations and the router??? Any easier way or even alternative I should be aware of?

I am trying to learn more about intranet's and how domain names, etc are resolved, naturally this has led me in the direction of DNS a few times.

I'm still confused though, if all I wanted to do was have some internal domains names (ie: http://www.pcspectra.dev) what exactly needs to be done?

I assume that I can use the TLD .dev when setting up an intranet?

I have 4 computers connected to a wireless linksys router. I have one machine act as a linux server which I develop software on before uploading to my shared host in the Internet.

I typically access the server using the IP 192.168.1.103 (or whatever DHCP assigns -- but it's typically static unless I unplug router or power failure) but ideally I would like to use a FQDN like http://www.pcspectra.dev

Is it possible to configure my router to recognize that FQDN and somehow route all requests to the computer of the matching IP? Even if I have to re-assign the domain to the IP when power failure, I really just want this domain to work internally and the router config options seem to require me to use DynDNS.com (or similar) which as I understand is for serving web pages to the Internet and to assist in re-mapping the IP to domain when my IP is updated/changed by my ISP???

Everything I have read thus far mentions DNS, but I would rather avoid messing with the beast. :P Ideally I would like to just map the IP of the Linux box (LAMP server) to a given number of FQDN's (ie: http://www.pcspectra.dev, help.pcspectra.com, http://www.booger.com, etc) I only have the one IP so I would configure Apache to use name based virtual hosting, I guess!?!

Does a router typically allow this kind of intranet configuration? Do I absolutely have to use DNS? Which computer would have DNS installed? The linux machine? If this is the case, how then do my Windows machines know that when the domain's I mention above are requested, they are to use the Linux machine DNS and not the Internet? Do I add the domain and TLD to each Windows machine hosts files?

Any help greatly appreciated. :)

Cheers,
Alex

Re: Intranet domain names

Posted: Sat Feb 21, 2009 4:28 pm
by onion2k
I just add them to Apache as virtual hosts, and then add them to each computer's .hosts file to point the 'domain' to the right IP. If you're only doing a few it's not that much effort.

Re: Intranet domain names

Posted: Sat Feb 21, 2009 6:30 pm
by alex.barylski
If you're only doing a few it's not that much effort.
It's not so much about effort as it is, I am curious to know if it's possible via a router and/or how the guys at my work managed to use an internal domain without resorting to DNS or hosts file, at least when I asked if they used a host file, they both looked at me like deer caught in headlights. They had no idea what I was talking about so I"m curious to know how they achieve an internal domain in the company intranet

Re: Intranet domain names

Posted: Sat Feb 21, 2009 8:23 pm
by VladSun
Instead of editing hosts file on each computer, I would have preferred to setup a DNS and use it as a primary one to all workstations in a subnet.
It will be a caching DNS for all domain names which are outside development domain name set and will resolve the IPs of all development domain names. Using views is even more useful - this way a domain accessed by a "development" subnet is resolved to a different IP than a domain accessed by Internet network.

Re: Intranet domain names

Posted: Sun Feb 22, 2009 6:11 pm
by alex.barylski
What is a subnet? Which machine would have DNS installed? The Linux machine, in which case would I need to disabled DHCP in my router, etc?

I asked the other developer at work if he setup DNS and he said no, so I assume we are using some DNS setting in the router...

Re: Intranet domain names

Posted: Mon Feb 23, 2009 4:36 am
by VladSun
You are mixing different services which work independently. By using "private subnet" I mean the logical subnet (e.g. 192.168.0.0 /255.255.255.0) in a single physical network segment (i.e. OSI layer 2 - computers interconnected with "transparent" devices only - switches, hubs, bridges, but not routers).
Each of these: DHCP, DNS and router may run on a different machine. While the DHCP and the router must be in the same subnet, it's not true for the DNS - it may be run on a machine anywhere in the Intranet/Internet network.
Because of that, DHCP and the router are usually put on a single machine. DHCP protocol uses a UDP broadcast to request/discover the DHCP service. The router (also known as gateway) only need to know what network subnets it has to route to the Internet. When a private subnet has to be routed a source NAT routing is used - all private IPs are masqueraded with the public IP of the router. That's because private IPs can not be routed in public (Internet) networks.

What I suggest is to use a DNS service running into the private subnet which will resolve different IPs (private and public) depending on where the request comes from (IPs from your private network or IPs from Internet network.)
So, let's have your development WWW server with private IP 192.168.0.1, your developer station with private IP 192.168.0.10 and your router with public IP 90.0.0.1 (with port forwarding to WWW and DNS servers if SNAT is used). Also, let's have your DNS resolving the domain mysite.com. When a DNS request is received from 192.168.0.10 it will be resolved to 192.168.0.1. When a DNS request is received from Internet mysite.com will be resolved as 90.0.0.1.
This is done because if you try to reach your WWW from inside your private subnet while trying to use the public IP (90.0.0.1) port forwarding will not be done (also the web interface of the router may be opened :) ).