IIS Website IP Change - asp.net

So my IIS7 server was hosting an ASP.Net web site with domain xxx-xxx.com with IP yyy.yyy.yyy.yyy.
Few days ago, I changed my ISP, which in result, changed my IP address to zzz.zzz.zzz.zzz.
Obviously the web site is down at the moment.
ping xxx-xxx.com
Results into:
Pinging xxx-xxx.com [yyy.yyy.yyy.yyy] with 32 bytes of data:
Request timed out.
Reply from yyy.yyy.yyy.yyy: Destination host unreachable.
Request timed out.
Reply from yyy.yyy.yyy.yyy: Destination host unreachable.
Ping statistics for yyy.yyy.yyy.yyy:
Packets: Sent = 4, Received = 2, Lost = 2 (50% loss)
As seen above, domain name xxx-xxx.com is still assigned to my old IP address yyy.yyy.yyy.yyy xxx-xxx.com.
According to my friend, and excuse me my ignorance and lacking experience, there's a really simple step I must take in IIS7 in order to get the web site back online, however, I'm not entirely sure how. I tried editing bindings and setting IP address, however that does not work, neither did netsh iplisten add work.
Furthermore, correct me if I'm wrong, but do I need to go to the place domain name was bought from and change assigned IP address?

Here's the command
netsh http add iplisten ipaddress=xxx.xxx.xxx.xxx
It is necessary to restart IIS7 for the change to take affect.

Related

Unable to use domain name as replcement for ws protocol ip

I am using a websocket connection with an ip address like ws://172.168.41.61. It is working fine. Now I want use the same service from an Android/IOS application, so I purchased a domain say, mydomain.example. Now I linked the above ip to this url: api.mydomain.example. But when I tried to use ws://api.mydomain.example it is not working as a replacement for the above IP address.
I have following 2 concerns:
Is it safe to deploy IP address (172.168.41.61) directly in the app for any API or websocket connection. (I guess no, because IP may be difficult to manage or bad practice, offcourse IP will be static)
Although I have tested the domain (api.mydomain.example) to IP conversion and the IP address is same as expected, then why can't I use the domain like ws://api.mydomain.example as a replacement for ws://172.168.41.61?
This the site from where I check the domain to IP conversion:
https://ipinfo.info/html/ip_checker.php
It is working now. There may be 2-3 issues because of which it was not working earlier:
Domain pointing takes some time. (But I waited for atleast 1-2 hour after pointing the domain and still it didn't work). May be it take more than that, sometimes.
May due to cache issue, when I tried the first time, the no response thing is cached and it continued to show the same thing even after 2-3 hour.
Although I confirmed the domain to IP is converting fine, still the cache in the my system was preventing me to access the original resource.
Thanks

IP address issue when deployed in Server

I have a Servlet project developed using Tomcat 7.
My projects logic is that whenever a request comes from certain IP it responds to the same IP with a new instance of browser as an response.
When I run and test this application locally it works perfect and by the way my local working IP address will be something like this 10.52.xxx.xxx. So request has 10.52.xxx.xxx and response is given to 10.52.xxx.xxx and all happies
Now things looks perfect and I planned to deploy this project in a Server which has an IP addess of 172.32.xxx.xxx and I have completed deployment of the same.
Now the issue which I am facing is that when I try to make a request to the project in the server (172.32.xxx.xxx) from my network (10.52.xxx.xxx).
In my project I have code like
String ip = request.getRemoteAddr(); //gets request IP address to give a new instance of browser
Now the variable ip contains an IP address of 172.32.xxx.xxx. So my code will try to give a browser instance to 172.32.xxx.xxx which doesn't exist. It should ideally give the browser instance back to 10.52.xxx.xxx as this is from which it had received the request so it has to respond to this IP.
I know both Server and the client request are in different IP network but I would like to know all possible solutions to fix the same so that browser is given back to 10.52.xxx.xxx.
Any help highly appreciated.

IIS 10 Site Bindings wildcard development machine

I have successfully setup IIS on my local development machine (dev branch - setup as localdev.me) but when I went to setup another branch (hotfix - setup as localhotfix.me) I am running into issues. The issues are due to the way the site is setup. The subdomain of the url is used to determine which Database to connect to. So going to host.localdev.me will connect to the host database. So in IIS I have the following settings for the bindings of the site.
Type Host Name Port IP Address
http localdev.me 80 *
http *.localdev.me 80 *
I can ping localdev.me with any subdomain and I get the loopback address as expected. When I then setup the hotfix branch (exactly the same as the dev but with the following bindings) I get name not resolved errors.
Type Host Name Port IP Address
http localhotfix.me 80 *
http *.localhotfix.me 80 *
Is there a reason the first setup would work and not the second? What is perhaps even stranger if I tell IIS to stop I can still ping subdomains on localdev.me and get the loopback address.
I could always get it working by manually specifying the host name in my windows hosts file but I would rather not do that as I would need to go in and edit the file every time we add a new subdomain.
EDIT: These are the specific errors I am getting.
ping localhotfix.me
Ping request could not find host localhotfix.me. Please check the name and try again.
EDIT2: I have a solution that works fairly well. It requires Acrylic DNS and installation of the Microsoft Loopback Adapter. I set the loopback adapter to a valid IP Address and set the DNS server to 127.0.0.1 then edit the AcrylicHosts file to contain entries for each domain with a wildcard. Once I did all of this I was able to ping localhotfix.me along with *.localhotfix.me. I believe the reason localdev.me worked is because it is a valid domain. The name would resolve at which point I believe IIS was able to take over. But thats really just an educated guess. But kindof makes sense as to why it worked for one and not the other.
The reason *.localdev.me works without a hosts file is because the public DNS for that domain resolves to 127.0.0.1 as long as it is not localdev.me or www.localdev.me. You can check this using nslookup *.localdev.me (replace the asterisk with anything except www) while your hosts file is empty. On the other hand, *.localhotfix.me is not registered in public DNS at all, which is why you'd need a hosts file entry for those.

IP address from nslookup sometimes doesn't work, e.g. with wikipedia

As I understand it, nslookup [domain_name] will give you the IP address of a domain name. When I run nslookup wikipedia.org, I get
Server: 138.23.146.213
Address: 138.23.146.213#53
Non-authoritative answer:
Name: wikipedia.org
Address: 198.35.26.96
So if I enter 198.35.26.96 in my web browser, I should reach wikipedia.org. This works for some websites, like google.com and facebook.com, and mozilla.org. But it gets an error for other websites, like wikipedia.org, craiglist.org, and wordpress.org.
Does anybody know why?
An IP address identifies a server, not a website. There might be more than one websites hosted on the same server.
When you enter a domain name (eg. wikipedia.org) in your browser's address bar, your browser first resolves the domain name to get an IP address (that is 198.35.26.96). Then it constructs an HTTP request having a parameter named Host with a value wikipedia.org and sends it to the address 198.35.26.96.
The server receives the response, reads the Host parameter and knows which website the user is looking for. So the browser essentially needs both IP address of the server and domain name of the website to open it.
In some web servers a "default website" might be defined, that is if the Host parameter is absent or its value is an IP address then the server will serve the default website to the user. This was the case with google.com and facebook.com. If a default website has not been set (eg. in wikipedia.org), the server will simply reply with an error saying the domain was not found.

subdomain URL not accessible through browser

I am facing a strange issue.
My ISP has hosted a webservice inside a virtual directory which is placed under a subdomain. now from my system (or network) I cannot access that webservice. Every time I run fiddler, I see a DNS Lookup for "my_sub_domain.com" failed. No such host is known.
But If I run it through web-sniffer.com, it is returning as Status: HTTP/1.1 200 OK
I do not understand what is wrong, Have anyone faced something like this? Is there any problem with my network settings? Can you tell me how to fix this?
If you need any more information please let me know.
This sounds like a DNS issue. Your DNS server doesn't seem to have had the A record for the subdomain propagated to it yet, whereas the DNS server used by web-sniffer.com has had it propagated to it, and thus, can see that it's returning a valid record and IP address.
While waiting for it to propagate to your DNS provider, you could add an entry to your machine's host file with the correct IP address to allow you to continue work.

Resources