You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在本地Windows Server 2012的IIS 8.5服务器上配置子域名?

Got it, let's walk through setting up subdomains for your local IIS 8.5 server (SERVER_1) step by step. Since this is an internal setup, we’ll focus on the two critical pieces: configuring IIS to recognize the subdomain, and making sure your internal network knows where to send traffic for that subdomain.

Step 1: Add Subdomain Binding in IIS
  • Launch IIS Manager on SERVER_1: Press Win + R, type inetmgr, and hit Enter.
  • In the left-hand Connections pane, find and select your existing MediaWiki site (the one that’s currently working with http://SERVER_1).
  • Right-click the site and choose Edit Bindings... from the menu.
  • In the Site Bindings window, click the Add... button.
  • Fill out the binding form with these details:
    • Type: Select http (pick https if you use internal SSL—just make sure you have a certificate set up).
    • IP address: Choose either your server’s specific internal IP (e.g., 192.168.1.100) or All Unassigned if you want the subdomain to respond on any IP the server uses.
    • Port: Keep 80 (or your custom port if you’re not using the default).
    • Host name: Enter your desired subdomain, like wiki.SERVER_1.local or docs.SERVER_1—use whatever naming convention makes sense for your internal setup.
  • Click OK to save the binding, then close the Site Bindings window.
Step 2: Set Up Internal DNS Resolution

Your internal computers need to know that the subdomain points to SERVER_1. Choose the option that fits your network size:

Option A: Local Hosts File (For Individual Test Machines)

If only a few PCs need access, edit the hosts file on each client:

  • Open Notepad as Administrator on the client machine.
  • Go to File > Open and navigate to C:\Windows\System32\drivers\etc\hosts (you’ll need to select "All Files" from the file type dropdown to see it).
  • Add a line at the bottom like this:
    192.168.1.100  wiki.SERVER_1.local
    
    Replace 192.168.1.100 with SERVER_1’s actual internal IP, and wiki.SERVER_1.local with your chosen subdomain.
  • Save the file, then flush the client’s DNS cache by opening Command Prompt and running ipconfig /flushdns.

Option B: Internal DNS Server (For Entire Network)

If you have a dedicated internal DNS server (like Windows Server DNS), add an A record to make the subdomain available to everyone:

  • Open DNS Manager on your DNS server.
  • Navigate to your internal domain zone (e.g., SERVER_1.local or your company’s internal domain).
  • Right-click the zone and select New Host (A or AAAA)....
  • Fill in the details:
    • Name: Enter just the subdomain part (e.g., wiki for wiki.SERVER_1.local).
    • IP address: Input SERVER_1’s internal IP.
    • Check Create associated pointer (PTR) record if you want reverse DNS (optional, but useful for network troubleshooting).
  • Click Add Host to save the record.
Step 3: Test the Subdomain
  • Grab an internal client machine, open your browser, and navigate to your subdomain URL (e.g., http://wiki.SERVER_1.local). It should load your MediaWiki site just like the original http://SERVER_1 URL.
  • If it doesn’t work, double-check these common issues:
    • Did you enter the correct host name in the IIS binding?
    • Is the DNS/hosts file entry pointing to the right IP?
    • Is SERVER_1’s firewall allowing incoming traffic on port 80 (or your custom port)?

Quick Note

If you want the subdomain to point to a completely different site (not your existing MediaWiki), just create a new site in IIS, repeat Step 1 with the subdomain host name, and make sure the DNS record still points to SERVER_1.

内容的提问来源于stack exchange,提问作者test

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 07:49:55