How to give Alias name for My Website - asp.net

I have deployed my ASP.Net Site in one of our server which is in ip format. So, I used to browse it like… http://xx.xx.xx.xx/MySite
But, I want to get out of this IP and give some text. How can I achieve this.
Also, I can’t change the Host alias name.

you can add name for ip address in file [windows directory]/system32/drivers/etc/hosts but it works only on local machine. If you want solution for network, you should have access to DNS server

Your server definitely has a name. You can use this name to access your site instead of ip address. smth like http://myserver/MySite
Thanks,
Arty

Related

I want to access Zammand (which runs on nginx) from the mobile app but i get the standard "welcome to nginx"?

Like the title says it, I need to configure my server to that it is reachable via the IP. I'm just asking where i can redirect/reroute it in the config?
Thanks
So i found out that in the nginx config you have to add an ip and an DNS Entry and it works :)

Is it possible to access website through IP address and path to index file?

Is it possible to access website through IP address with path to index file instead of domain name?
Example:
Domain: Youtube.com
IP address: 216.58.209.142
Trying to access the website through IP address won't work. I understand this is because there can be multiple websites on the same IP address and the settings which directory gets sent to the user is set in nginx/apache.
Is it possible to visit the said website through for example 216.58.209.142/youtube/path/to/directory/index.html ?
If this works then how would I be able to get the full URL path?
Just curious, I'm not trying to achieve anything particular.
In general it's not possible.
Server can block your request even if you provide a correct/existing path, allowing you to access the data only using a correct domain name.
Just replace the www.youtube.com with YouTube's IP. For example: 216.58.209.142/index.html (I don't know if YouTube has index.html, but if it did that's how you would access it)

Adding Hostname to servers hosts file still doesn't work

On server: I go to start -> run and type "drivers" change to the etc directory you want to edit the hosts file.My website was seen when i go from iis(from the server) Right click websitename>Manage website>Browse.
On local computer: (This computer can access the server)I open browser>type the hostname on url , i can't view the website. How to resolve this?
Please check the following:
Under IIS (inetmgr), is application binded with any IP?
If answer to #1 is YES, use that IP in your host file. If NO, you can
either use user machine IP or localhost (i.e. 127.0.0.1).
Thank you

IIS Adding URL instead of IP

I have a local only ASP.NET MVC app hosted in IIS, and I was wondering how I could use a URL instead of an IP? At the moment I access it using http://127.0.0.1, but I'd like something like http://foo instead
In IIS, you need to add a binding to the website, here you can specify the hostname i.e. foo.xyz.com
However, you will need to make sure that the DNS resolves that hostname to your IP address
You could add this line to your host file:
127.0.0.1 foo
You can find the host file here:
C:\Windows\System32\drivers\etc

How to block 127.0.0.1:8080

I am trying to block http://127.0.0.1:8080/ in C:\Windows\System32\drivers\etc host file. so what i did is:
127.0.0.5 http://127.0.0.1:8080/AccessCtrl/login.jsp
But is not working, i can still access this site.
As I know ,hosts file is for DNS caching .
I mean one side must be an IP address and the other side must be Domain name server. So you can't do such a thing.
The hosts file only maps domain names (e.g. www.example.com) to ip addresses.
Therefore your approach won't work for two reasons:
What you're trying to block is not a domain name, but a URL
The URL you're trying to block doesn't contain a domain name, but an IP address.
You should be able to "block" the domain "localhost" this way, but you'd still be able to access http://127.0.0.1:8080/, just not http://localhost:8080/.
What you need here is a firewall, like the windows firewall.

Resources