IIS DNS and multiple websites

AJF 1 Reputation point
2022-02-20T16:51:48.307+00:00

guys,

In a lab(srv 2019), with no acces to the Internet, i am testing IIS.

i need help with acces the testwebsites, i dont want to edit the hostfile.Is it possible to do this with dns and if so , how?So if i want to acces testsite1.mycompany.local and testsite2.mycompany.local how should i do that in dns? Or do i need to do something different?Many thanks and regards.

Internet Information Services
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,914 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Anonymous
    2022-02-20T16:56:58.067+00:00

    Try creating an A record www.testsite2.mycompany.local on your DNS server.

    --please don't forget to upvote and Accept as answer if the reply is helpful--


  2. Arpit Dubey 1 Reputation point
    2022-02-20T17:08:22.007+00:00

    No Problem...

    its easy..

    edit LMHOSTS.SAM file.. you can find it in same folder with hosts, at "C:\Windows\System32\drivers\etc"

    kindly add two lines as given below

    127.0.0.1 testsite1.mycompany.local
    127.0.0.1 testsite2.mycompany.local
    ...
    For doing this you need to open notepad with administative priviledge
    hope you can do it.
    please do not hasitate to write at Q&A, here, if any query
    good luck


  3. Bruce (SqlWork.com) 64,006 Reputation points
    2022-02-20T17:58:40.6+00:00

    You should probably use cname records for host header names, especially if use DHCP

    0 comments No comments

  4. AJF 1 Reputation point
    2022-02-20T20:04:51.86+00:00

    A records or cnames, or both. Am not sure about that and cannot find any decent info


  5. Bruce Zhang-MSFT 3,751 Reputation points
    2022-02-21T02:12:59.61+00:00

    Hi @AJF ,

    The only ways for a computer to know the mapping between a domain name and an IP address are DNS or local hosts file. So if you don't want to edit hosts file, edit DNS is more suitable for you.

    If you have owned DNS, you can add a record to map root domain to IP. Just click IPAM in Server Manager and navigate to MONITOR AND MANAGE, click DNS Zones and Forward Lookup, then you can add a DNS record. More steps can refer to this docs.
    176140-1.png

    Otherwise, please contact your DNS provider to set record for you.

    As for CNAME, I personally recommend it for setting up subdomain mappings. Map subdomains to hostnames instead of specific IP addresses. You can get reasons from this docs.
    176231-2.png

    There are actually two other alternatives, a WINS server and the LMHOSTS.SAM file.
    Windows used the WINS server long ago when DNS was not in use and it still works today. But you need to prepare a separate Windows server for this.
    The LMHOSTS.SAM file works like the HOSTS file, but with a different syntax; it's also located in the same place: C:\Windows\System32\drivers\etc.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Bruce Zhang

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.