2

I have a website hosted on my LAN, and I want my users to go to myWebsite.com rather then my internal IP address. I have Windows Server 2012 running a domain and IIS for my website. I know I can add my site to the hosts file, but I was hoping there would be a better way. (The site is internal only)

3 Answers 3

1

You already have a DNS server

Your Windows Server 2012 machine already has the DNS role added if it's a domain controller. You just need to do a few things to get this set up:

  • Configure forwarding
  • Add a CNAME record for your website
  • Point other machines to use this server for DNS

I don't have a Windows 2012 box ready, otherwise I'd screenshot the heck out of this. You might be able to find this stuff by fumbling around and Google'ing though. I'll give you the basics of what you're looking for.

Keep in mind this is all terribly, terribly simplified:

Configuring forwarding:

When your DNS server can't find an address it needs somewhere else to look. I like to add 8.8.8.8 as a forwarder (Google's DNS server). This way, when your client computers ask for Superuser.com, which your server doesn't have a record for, the request will be forwarded to 8.8.8.8.

Technet page on how to configure forwarding

Add a CNAME record

You'll need an address for your webpage. Adding a CNAME record to the forward lookup zone of your domain will give you a subdomain-style address. So if you've got usta.com for your domain and you add a CNAME record foobar, you'll get foobar.usta.com. This is a pretty common way to handle intranet pages.

You could add another forward lookup zone and then a www CNAME record to get whatever domain name you want, but then we're creating another forward lookup zone and risking collisions with domains you don't own. Let's just follow the KISS principle.

Technet page on CNAME records

Use the DNS server!

Now we need to point our clients towards the DNS server. It's probably best to do this using DHCP. Get on your router's configuration page, find the DHCP settings, and replace the DNS server with the IP address of your Windows Server 2012. Now either wait for all the clients to renew or force them to renew.

You could also configure everything statically (ew) or configure only DNS statically.

Use the Googles!

To be honest, this answer isn't going to get you far. I am hoping though that it will help you learn where to look.

1
  • I'll give that give that a try and see what happens.
    – Usta
    Jan 11, 2013 at 3:20
1

Users on your network should already be able to access it without typing in your ip by using your computer's name. If you go into the server manager, look at what the computer's name is set up to be, within IIS you can create a binding to that name on all ports. Users will be able to use that name to access the website.

On a basic network, DNS lookups are done by your router. You can set up your router to do a forward lookup of another name, to your IP - if you did that, users would be able to find your website on the network by going to http://yourwebsite.yourdomain.yourdomainsuffix/ That would all be set up from your router's setup page.

If you can't do this from your router, then you would have to set your server up to be a DNS server. This is a windows server role, and it is not for the feint of heart. Once set up as a DNS server, you could go into DNS management and create a second forward lookup for your computer.

1
  • The IP is not the default, and I have a diff. site set to use the default interface.
    – Usta
    Jan 9, 2013 at 23:58
1

On the internal LAN, you would use the computers NetBIOS name as long as they are on the same IP segment. This is also the same as their DNS name if you are in a Windows domain environment. If the latter is true, you should already have an entry in DNS for the computer that is hosting the IIS web site. As noted in the previous response, you can add the computer name to the bindings within IIS to ensure that you can resolve properly to the web site.

If you truly want to be able to get to this site using dotted syntax (mycompany.com) then you will have to add another forward lookup zone and appropriate records in DNS for the name you want your users to use. You would then make sure the bindings in IIS match the name used in DNS.

1
  • I would have to add the 'friendly' name as well as the IP to the IIS binding field?
    – Usta
    Jan 9, 2013 at 23:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .