In the first place i should say that it might seem a bit weird but its a challenge to distinguish between the level of these configurations,for example ,say i want my localhost be accessible through abc.com, i know i should go through two steps:
1.use iis manager bindings
2.add abc.com to dns host file
127.0.0.1 abc.com
But is not clear for me level of these configs and what is each part's responsibility ?
In a complete url request, steps as follows
User request abc.com.
DNS is request for abc.com.(That is why add abc.com to dns host file)
IP address for abc.com is returned.
Browser send request to the IP address.
IIS in server return site’s page.(That is why use iis manager bindings)
Complete request
Why to use host file
Related
I have a Windows Server 2012 with IIS 8 installed on it. I have just one website configured which is the default web site. It contains an application which is configured as follows:
The physical path points to the app directory, where I have a web.config and a Service.asmx file
the virtual path of the app is set to /service
With this configuration, my app can be loaded via: 127.9.9.9/service/Service.asmx (let's say 127.9.9.9 is the IP of my windows server here). This works both locally on the Windows server as well as from an outside machine. So far so good.
But now I wanted to make the app accessible via a domain name, because obviously it is a better and more common solution than going via IP. So, I added a binding for my default web site in IIS with a hostname, let's call it mydomain.com. I left the other binding settings default, i.e. the binding works on port 80 and with any IP address.
After having configured the binding, the app is now also accessible via mydomain.com/service/Service.asmx, but only locally on the Windows server machine! When calling this URL from an outside machine, I just get
site not found
Of course, mydomain.com has a redirection to the Windows server, i.e. to IP 127.9.9.9. And when calling just mydomain.com, it successfully redirects to the Windows server, and I get to see the standard IIS welcome screen. However when trying to accessing the app mydomain.com/service/Service.asmx it fails.
After having done some research it seems it's a DNS issue. So, following a tutorial, I configured a forward lookup zone, which maps the hostname mydomain.com to the IP of the app server. Note that this is not 127.9.9.9, the app server has a different IP! But as I understood, that's how it is supposed to be configured? Also, I added a reverse lookup zone for that IP. As it still didn't work, I even played around with the network adapter of the Windows server, and added the app server's IP at the top of the list of DNS ip's. But still it doesn't work.
I'm afraid I don't quite understand the DNS part fully. Maybe is there something missing in the configuration of mydomain.com? As I said, I configured a redirection ("MX") from a hostname to the Windows server IP. I don't understand my mydomain.com successfully leads me to the Windows Server start page, but mydomain.com/service/Service.asmx cannot be found.
Basically you should do following configurations to access your site through the domain. This is mainly three step process.
Changes at your domain registrar: It is good practice that you register private nameservers at your domain registrar. You will have to assign your app server IP in the nameserver. So assuming that your app server has IPs like 72.11.11.11 and 72.11.11.12, you should register nameservers as below
ns1.mydomain.com - 72.11.11.11
ns2.mydomain.com - 72.11.11.12
Once the nameservers are registered, assign them to mydomain.com
Next you have to configure the DNS manager of your app server. You will have to add following DNS records.
Name: # (or blank)
Type: A
Data: 72.11.11.11
Name: * (a star)
Type: A
Data: 72.11.11.11
Name: www
Type: A
Data: 72.11.11.11
Name: (blank)
Type: NS
Data: ns1.mydomain.com
Name: (blank)
Type: NS
Data: ns2.mydomain.com
These are minimum DNS records which you will have to add. There are many other which you can add like MX, ftp, mail etc based on your requirement.
The last action is to be performed in the IIS. Click on the site name mydomain.com in the IIS. In the right side Action pane, click on 'Bindings' under Edit Site section. You should add two bindings.
Type: http
IP: 72.11.11.11
Port: 80
HostName: mydomain.com
Type: http
IP: 72.11.11.11
Port: 80
HostName: www.mydomain.com
Hope above will help you.
Regards,
C
My client have a dedicated server on liquedweb cloud service and we my web app is hosted on that server. We want our users to map their domain to our server. So they can enjoy our web app by using their domain name. What information I need to provide to my user so he can map domain and what information I need from them?
I don't know much(in fact anything) about domain mapping
thanks
It depends if the server has a dedicated IP address or is natted.
If the server has a dedicated IP address you can ask your clients to point their entire domain to you server by adding the following A records:
Host TTL Protocol Type IP Address
# 300 IN A 1.1.1.1
www 300 IN A 1.1.1.1
Not all domain hosts ask for TTL,if not dont worry about it.
If you want just their subdomain to point to your server (subdomain.website.com)
subdomain IN A 0.0.0.1
TTL is optional in some systems, in this case the default will be used.
Generally it is recommended that you use an IP for the Apex record and not a domain name. EG: example.com is the apex, www.example.com is the www subdomain.
A typical configuration would be below:
Host TTL Protocol Type Result
# 300 IN A 1.1.1.1
www 300 IN CNAME example.com
This is the same config as the top example but using CNAME example.com. It is the same as using A 1.1.1.1, it just means you only need to change one record.
If your server details are a hostname and not an IP address, most systems will not let you use the hostname for the apex so you will need to find out the IP address. (A simple method is to use the nslookup command or dig command).
TTL is how long in seconds a record last before it expires. If you are unsure what you are doing I recommend lowering this so you can correct mistakes more quickly.
Different methods for the different servers. For most of the servers, you have to change the nameservers of your domain.
This mostly needs when your domain registrar and hosting provider both are different.
First Login into your hosting account, navigate to the account details,
then copy the nameservers from there...which would be like :- dns1.hostingprovider.com
dns2.hostingprovider.com
After that, Go to control panel of your domain. Navigate to the nameservers
You will see the link:- dns1.domainregistrar.com
dns2.domainregistrar.com
Paste the above links at the place of below links.
They need the IP address (and possibly instructions on how to configure their DNS servers (which means a variety of different sets of instructions for different servers and control panels)).
You need the domain name.
I am unsure Whether both DNS server and Host file are the same or different.
I Hosted an application in IIS and created A host name as website1.domain.com and tried to browse it and it didn't work.
When searching on net i found that we need to make entry in DNS server or Host file.
As in most of the sites that I saw mentioned DNS server or host file. I am unsure Whether the both are same or they both are different.
A hosts file is used by Operating Systems to manually specify the IP addresses for specific domains/subdomains - think of it as an override.
DNS however is a server - think of it as a registry - that keeps track of records pertaining to domains, such as A records, MX records etc.
For the purposes of a local test site, an entry in your hosts file would be sufficient, however for a live site, a DNS entry relating to the domain you wish to have your site hosted on would be required.
Choosing which to use comes down to a few things. Does the server upon which your hosting the site use its own DNS server, i.e. a DNS server on the same network, which the connections to the server will be using as well? Does the domain name the site uses have its nameserver set to one that is externally available (i.e. 123-reg.co.uk). If either of these cases are true, you could probably use a DNS server.
If not, is the server hosting the site running on the same machine as the client that will be viewing the site? If so, you can probably use a hosts file, pointing your domains to the localhost IP of 127.0.0.1, ensuring the domains match the bindings in IIS.
Dns server is a server that will help to resolve dns names. ie when you type google.com in your browser , the name will be passed to the dns server provided by your isp. then it will be resolved to ip address by the dns server and your request will be routed to the google ip address by isp network. host file is different one. if you add www.mydomian.com entry in your host file and map it to an ip address 192.168.0.1 then your computer will check ion your host file when you type www.mydomain.com, whether there is any entry for mydomain.com in your host file, and if exists it will be routed to that ip address. in case if there is dns server and you set that server ip in your hnetwork configuration in your pc, then all the domain name request will be sent to that dns server(if there is no host entry exists)
I am having an issue getting an IIS 7.5 website to answer when I connect to it using an IP address.
I have a Win2008 Server set up with IIS 7.5. It has only one IP address bound to it (10.10.10.10), and IIS listens on it just fine. I have IIS hosting two websites: defaultsite and mysite. Both of these two are necessary to be present. (To be fair, I have many more sites, but 2 will simplify things.)
Defaultsite is your typical IIS default site and has an IIS binding of "*:80:"
I want to access "mysite" via the DNS name but also the public IP address 1.1.1.1. So I've added the appropriate bindings:
":80:1.1.1.1"
":80:mysite.com"
My DNS and load balancer are moving traffic just fine to the IIS server. Everything works fine when hitting the server via "mysite.com" and I get the defaultsite if I try other ways to get to the server.
The problem is when I use 1.1.1.1 to get to the server, I get there, but I'm still sent over to the "defaultsite" rather than "mysite." My IIS logs and the file contents I retrieve verify this behavior.
Any ideas on how to get an IP address set as the host header on a site binding? (Searching for this situation is vexing; since all my key terms are present any time you work with host headers/bindings.)
Remove the binding for *.80 from the default site and make it respond to 10.10.10.10 and then your other site will get picked up when you type the 1.1.1.1 site. IIS is responding to the request but the rule states 'If any site comes through on port 80, respond to the default site'. The DNS name works because you are going by name and the lookup is not there on the default site.
I have a domain with wildcard - *.mysite.com hosted on Server1
I am planning to host a sub-domain - sales.mysite.com on Server2.
Is this achievable? If yes I have a couple of questions on this.
How does DNS know to which server to point when sales.mysite.com is requested?
Does all traffic come to the Server1 and then redirected to Server2 if the destination calls for sales.mysite.com?
this is very easy to achieve. you need to configure your dns server that subdomain.mydomain.com points to server 1 and subdomain2.mydomain.com points to server 2. the traffic won't be routed via server 1. it will directly go to server 2. thats how DNS works. In the DNS server for each domain an ip address is stored. you just need to specify your 2 ip addresses the correct way for the subdomains and it should work. more infos you can get from wikipedia http://en.wikipedia.org/wiki/Domain_Name_System