IIS: published asp.net app replace ip with domain name - asp.net

I have already rent an online server.
I'm installing IIS on it, hosting a website on it.
to access the site from internet, I must type: {ipaddress}/siteAppName
My question is how to use a name instead of ip address? should I buy and register a new domain name? if that the case how could I configure this ip with a new domain name?
More Details:
I am renting a dedicated server... so I have full access to the server as I'm hosting my website on it. but I don't have a domain name. either from local machine or remotely I can successfully access the hosted website using the ip address of my server/webAppName.. but the problem is that I'm trying to get ssl certificate, but the generated CSR is rejected from all SSL suppliers because the url is not accepted, and I think that it's not accepted because of using IP instead of a domain name. I mentioned many self-conclusions here, but I'm not sure about any of them... That's why I'm asking.

It depends on your hoster but most allow you to use a registered domain name. They should have instructions on how to set this up.

Related

Can't access some websites using their IP address

I have windows 10.
To get the IP address of some website I type ping somewebsite.com in cmd.
For example if I say ping google.com, cmd shows Pinging google.com [216.58.206.206] with 32 bytes of data: and some lines after that. If I type that IP provided (216.58.206.206), that gets me to Google.
But some websites aren't like this. For example for website codeforces.com I get 213.248.110.126, but this doesn't get me to the website, instead shows some error 404 Not Found .
Why it doesn't work and what is the best method to get IP addresses of websites in Windows 10?
Thanks.
Some websites cannot be accessed by IP only.
Think for example, a public (free or paid) web hosting, with shared IP. If you doesn't provide a domain name (FQDN), then the server doesn't know what page needs to be served.
Think also on some "public" services, like Azure DevOps. They provide you a FQDN over a microsoft domain, but probably each DevOps repository doesn't have their own IP. If you only provides the IP, then the service doesn't know what page are you requesting.
Also, if you enter to an HTTPS page, the certificate are securing the domain name, not IP address. If you try to enter with IP only, your navigator tells you the page are not secure (Try it with Google for example).

SSL Certificates explanation

Can someone answer a simple SSL Cert question for me to derisk my decision?
My Stack: Bitami WordPress instance on GCP VM.
Situation
I have a website with an SSL cert linked to my domain name.
I started an instance with a new static IP address.
I remapped the domain name to the new servers and added the correct credentials [confirmed everything is configured correctly with the GCP team].
Ran -dig command and confirmed new instance is mapped to the domain name.
Problem
The domain name will not load in the browser. Get the "NET:: ERR_CERT_INVALID" message.
My Diagnosis
I haven't transferred my SSL to my new IP address.
Confusion
Everywhere I read says the SSL is mapped to the domain name, not the IP address itself. So theoretically there should not be an issue.
Question(s) to you
Do I solve this simply by generating new SSL cert on the new instance? Will that just overwrite the old SSL cert and map my domain name to the new SSL cert?
If not - what's the solution?
I don't understand the technical relationship between IP address, domain names, and certs. I have read as much as I can and everyone seems to talk around it but not explain it in detail.
Thanks in advance!
Bitnami Engineer here,
If you created a new instance from scratch, you will need to migrate the SSL certificates from the first instance to the second one. You can either copy the SSL certificates from the machine or download them again from the CA website and substitute the files you have in the /opt/bitnami/apache2/conf folder.
In case you were using a Let's Encrypt certificate, you can generate new certificates by using the Bitnami HTTPS configuration tool (/opt/bitnami/bncert-tool) or by running the CLI tool to generate new certificates. If you use the Bitnami HTTPS configuration tool, you won't need to modify the Apache's configuration, the tool will do that for you. You can learn more about it here
https://docs.bitnami.com/google/how-to/understand-bncert/
Please remember to confirm that the domain name is configured properly by checking your domain using this online tool before trying to generate the certificates
https://www.whatsmydns.net/
New problem.
I used the bncert tool as per Jotas recommendation and it worked well.
I checked my domain name via 'whatsmydns' as well as my SSL via an SSL checking tool. All worked out as expected - my IP address is matching against my Domain name and SSL is matching against my domain name.
I type my domain name into the browser and it loads my site with the padlock, across all browsers.
So from the outside - it looks like everything is fine.
But I have two issues still.
Problem #1:
In my WordPress 'general>settings', I tried to update my 'WordPress address' and 'site address' but they are greyed out. So I updated my wp-config file with the new https addresses as per these instructions which have worked for me before without issues (https://www.wpbeginner.com/wp-tutorials/how-to-change-your-wordpress-site-urls-step-by-step/). It didn't break the site, but I could no longer log in. As soon as I deleted the new wp-config code, I could log in again. So if that won't work, I now have no course of action to update my 'WordPress' and 'site' addresses.
So my questions are - do you know why this won't work? Is it a bitnami quirk? And does it matter? If the domain is working, does it matter if I keep the wp-config file as an http address and not an https address?
Problem #2:
My domain name takes me to my site at the correct IP address. It loads with a secure padlock icon. I can log in. Everything works as it should.
If I use the IP address, however, instead of the domain name, it also loads the same site but as an insecure site with no padlock.
Question - Any idea how that is possible? I thought a domain name was just a human-friendly version of an IP address. And if the webserver is a single server, how can using a domain name versus an IP address generate different front end results?
Thanks again team, as a person who is new to this community, it really does give you faith in humanity.

Access Multiple Web Sites Hosted on single server on local network from workstations

I am trying to set up a secondary web site hosted on our local domain controller running IIS-8.
I already have one site working successfully thought our network, the default site.
I have successfully got the second one to work on the localhost (the domain controller Server 2012-R2), but I can't seem to access it from any of the other workstations on our network.
I added the new site.
Set the binding to IP address:192.168.1.1, Port:80, Host Name:dyo.mysite.com
I have modifed C:\Windows\system32\drivers\etc\hosts to show 192.168.1.1 dyo.mysite.com, and I have added an alias to the forward lookup Zone in the DNS Manager. (Name:byo.mysite.com, FQND:byo.mysite.com.mydc.com, Target Host: 192.168.1.1)
I can't seem to access the site from any of the network work stations. I have tried many combinations of addresses, http://byo.mysite.com, 192.168.1.1/byo.mysite.com, \mydc\byo.mysite.com, etc.
I would imagine that I am probably missing something simple. I just don't know it is.
Any insight would be greatly appreciated.
To get your server accessed from other workstation. You have to promise
Your IIS site can be accessed via IP address directly.
the client workstation is using your DNS
Your client workstation is not bypassing your DNS server by .pac proxy
So could you get access the website via IP address by disabling default website and set the site to unassigned IP or 192.168.1.1 with null domain name?
If you want to access the website via byo.mysite.com. Then you shouldn't set FQDN like byo.mysite.com.mydc.com. because Web browser will never consider byo.mysite.com as an alias but a different server. That's why When you set FQDN like byo.myDC.com, you could get work by access http://dyo and you could also access website via byo.mysite.com.mydc.com but fail with byo.mysite.com.
How to set DNS correctly
To get it work, please create an new primary Forward Loopup Zone named mysite.com. Then create a new HOST(A) record to map to your machine name like dc.mysite.com and 192.168.1.1. Then create an Alias(CNAME) called www to map to this A NAME. Then the FQDN will be www.mysite.com.
Finally bind your IIS site and access the website should work.
PS: Please make sure your other workstation is not using a proxy.

Make local web app accessable by http://LocalComputer/WebsiteName on IIS

I am trying to make web app accessible by http://LocalComputer/WebsiteName on IIS.
I am able to access it by http://computername:portnumber/
So what does my binding need to be and do I need a static ip?
Any help or redirection to appropriate resources will be greatly appreciated!
Is IIS setup on default port 80? If your document root is setup to website, you should be able to access it via http://computername/. If this is a local setup, and assuming your DNS is setup and working on the router, wont need a static IP although doubtful IP will ever change.
http://LocalComputer/WebsiteName this can be done locally without a static IP.
In order to make it publically over http you would need below things.
1) Registered domain name
2) Registered name servers
3) DNS zone created for the domain either with registrar or on the server
You can either host this website by renting a Windows VPS or a server and with the help of third party control panels like Plesk or Hosting controller.
OR
You can purchase a shared web hosting space from a windows hosting provider and upload your pages to make the contents accessible publically.
Another option would be to set multiple domains in your hosts file
domain1 192.168.0.10
domain2 192.168.0.10
...
Set IIS to bind and hosts multiple domain on the same IP. Then you can access each site locally by going to http://domain1 or http://domain2 etc...

How can we configure IIS for domain name mapping

I would like to configure IIS server at (Windows server 2003) for domain name mapping.
We have purchased domain name for one of our newly created website.
I would like to know how can I configure IIS so that anybody from outside world can reach website by typing URL.
As in: http://example.com/ should redirect to my the home page of my website.
I have made website in using ASP.NET and Oracle.
How can I do this?
You need to register your domain on a DNS server, which is different (though could be the same physical box) as your IIS server. Long time since I've done this myself, as I use a hosting company for this kind of thing, but you will typically need at least two DNS Server IP addresses typically for a domain (primary and secondary DNS servers). There is a DNS Server for the windows server platform, but most people use hosting services to do this thing.
By the way, you might get a better response posting this kind of question on serverfault.com, as it's not really a developer question.

Resources