0
votes

I have a website on IIS. I can access to the website with the ip address with any devices connected to the network. To increase the ease to access the website, I want to have a hostname on the website. On IIS, I have made changes on binding. And add the ip address on the file C:\Windows\System32\drivers\etc\hosts like that :

192.xxx.xxx.xxx     www.test.local

When I want access to the website, it is unreachable

Thank you for any help.

2
@joey Thank you for your reply, But if I want to use my smartphone device for example ? - mm98
You need a DNS server set up in that network, not editing hosts file. - Lex Li

2 Answers

0
votes

According to your description, you should set up a DNS server in your local network as Lex says.

A DNS server is a computer server that contains a database of public IP addresses and their associated hostnames, and in most cases serves to resolve, or translate, those names to IP addresses as requested.

After setting this , you could use your domain to access your web site.

Notice: It's only wroked in your local netowrk not public internet.

More details about how to set up a DNS server and configure a DNS server , you could refer to below article: https://support.microsoft.com/en-us/help/814591/how-to-install-and-configure-dns-server-in-windows-server-2003

0
votes

When you try to access your website using a domain, the request tries to find the server's IP address which is joint with the domain. DNS servers provide this service, they translate your domain to the IP address. Therefore, you should set DNS records on a DNS server, it can be on your own server or on a DNS server providers like "Cloudflare". So try to set your nameservers to your DNS server, then create A type records to point the IP address using your domain. Finally, your configuration on IIS will work.