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--
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
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--
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
You should probably use cname records for host header names, especially if use DHCP
A records or cnames, or both. Am not sure about that and cannot find any decent info
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.
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.
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