I have three localhost site with different port..
localhost:80
localhost:81
localhost:82
I want to make fake domains for each site, instead of type localhost:80 on browser, I would like to use a fake domain (such as www.myweb.com)..
I already tried edit the hosts file in C:\windows\system32\drivers\etc..
I add a line 127.0.0.1:81 www.firstfakedomain.com
to the hosts file
But it doesn't works!
is it any configuration to be made in this box...
In your host file don;t specify port number. Your host file should have entry like like below
127.0.0.1 test1.com.au
127.0.0.1 test2.com.au
In your IIS application specify host name as test1.com.au and test2.com.au for your applications on port 80.
AFAIK, port numbers are not for the host file resolution of domains.
You can do this configuring the fiddler host.
Go to Fiddler2 menu:- Tools > HOSTS
and then modify it for the IP address you want.
127.0.0.1:81 www.firstfakedomain.com
Save it and try this in browser.
Related
Trying to host a web site on my local Win 10 Pro machine withing IIS, provided I share the IP to my friends. My host file contains something like:
127.0.0.1 site1.com
127.0.0.2 site2.com
127.0.0.3 site3.com
127.0.0.1:1 site4.com
127.0.0.1:2 site4.com
123.45.5.6 site5.com
123.45.5.6:33 site5.com
They all work as expected except for the imaginary external ip (only for example), and adding the port or not makes not difference. Seems i've tried what makes sense, say my external is '1.2" Creating a host entry like
1.2 # or
1.2:Port # the external IP with port
Also attempted adding an exclusion for he firewall to help ensure the traffic is allowed by doing:
netsh advfirewall firewall add rule name="Open Port" dir=in action=allow protocol=TCP localport=81
Kind of lost what might be missing, any suggestions?
Thanks for he help.
First. There is no need to add port after IP address in hosts file. Port can be configured on IIS by setting binding.
Second. If you want to allow any web client can access the site host on local WIN10 pro, you need to make sure WIN10 pro and web client are in the same LAN. Otherwise it is need to buy a public domain and bind to WIN10 pro device.
Using Ping command is a great way to test traffic between devices. It can help you make sure if web client can create connection with WIN10 pro.
I have a network setup containing two machines.
On one machine I have a site hosted with IIS.
I have added an entry in the HOSTS file pointing my local IP to this domain
10.42.12.105 to - www.mysite.come. Then I configured to accept incoming calls on TCP Port 80. By going to windows firewall with advance security
Inbound Rules -> Action -> New Rule, select "Predefined" and then select the last item - World Wide Web Services(Http) and allow the connection. Also allowed port 80 too.
I can access the site with www.mysite.com with no problem on the same machine.
what I would like to do is be able to view this site from my other machine on the same network.
Can anyone see where I'm going wrong?
A host file is a way to tell 1 machine to map a web address to an IP address, like an alias. It only works on the machine containing the HOSTS file. For example, I could add a line in my hosts file which could map your URL www.mysite.com to 127.0.0.1. My browser would think your site is on my PC now.
So, if you want to set up this alias/name-mapping for multiple machines, you will need to add a host entry, on each machine (so they all have this mapping), or add this mapping to your local DNS (on your domain controller or router).
To check your firewall rules and IIS config, try having your test PC go to the IP address instead of the alias (from HOSTS).
How to bypass/manipulate HTTP_HOST?
I want, in a browser, that when I go to blabla.com, it actually opens example.com(ip:123.45.56.78).
Using windows .hosts file, I can bind blabla.com to 123.45.56.78 server, and manipulate it.
This works with dedicated ip websites, but on shared servers there are several websites binded with IP (if blabla.com is not set on that ip already) then it shows "FORBIDDEN, domain doesn't exist on server".
Is there any way that visiting blabla.com opened example.com?
The reason it doesn't work is the hosts file does not affect the HTTP host header sent by the browser.
It is possible to do that though if you use e.g. Burp Suite as an HTTP proxy.
Proxy > Options > Match and Replace allows the host header to be rewritten.
Options > Hostname Resolution allows the domain to be rebinded.
I'm runnning IIS 7 on my local dev machine. My website is up and running. To access the website, I need to enter the url with the port number in the browser's address bar (www.ScoobyDoo.dev:91). What do I need to change so I only need to enter the www.ScoobyDoo.dev portion of the url? I've done this before but I'm drawing a blank. Port 80 is hosting a different website so I can't just move this one to the default http port.
Thanks!
If you want multiple sites to reside on the same IP address then you need to use HTTP Host Headers.
Provided that your existing website doesn't use SSL then you can use host headers. To configure host headers in IIS7 you modify the "Bindings" (there's a menu item for this in the right hand side Actions pane for the site):
You want to add/edit your bindings for each site that resides on the same IP address, for example for your scoobydoo.dev site:
The caveat here is that if you have users already browsing your first site by IP address then they will need to be redirected to the site using its domain name.
You can do this by adding a site bound to the raw IP address and creating a HTTP Redirect.
I'm not sure what you're expecting to do here. If something else is binding to port 80, and your web server is binding to port 91, then you'll need to specify port 91 in the web browser when making a request to the server. By default, without being explicitly given a port in the address, a web browser will make the request on port 80 (or 443 for SSL).
You might be able to add an entry to your hosts file (c:\windows\system32\drivers\etc\hosts) where you map the non-specified port version to the specified port version, but I don't think it'll work. That file is for DNS resolution, not port mapping. Worth a try though, I suppose.
Can you clarify a bit on what exactly you're expecting? Or what you think you may have done before? I wonder if you're not giving us the whole picture here.
I'm building a few SharePoint sites, and I want to make use of zones so I may set security different in the various zones.
My workstation has a local SharePoint, and I use it for development.
My workstation has a static IP, and is connected to the internet.
When I make a SharePoint site, I want to add a host header, for instance, devbox.com.
I do not own this name, nor do I want to.
I then add an entry in my hosts file, but when I surf to http://devbox.com:8080, it does not resolve.
Do I need to register the name I want to use, or should this work, i.e., have my hosts file resolve names/IPs first?
It should work. You will need to make sure your website has the right mappings, though. For example, if you want your site to respond to http://devbox.com:8080, you'll need to either set up your website to respond to all IP addresses and port 8080, or to respond to the devbox.com host header and port 8080.
BTW, to test whether your HOSTS file is set up correcly, open up a command line and PING devbox.com. You should see the address resolved to your local machine's IP address. If not, you've done something wrong in how you've set up your HOSTS file... please post the line in the HOSTS file that you're using.
BTW, per my comment below, you should probably use 127.0.0.1 (aka localhost) in your HOSTS file line, rather than your external IP. This will remove the IP address as a potential point of failure (e.g. in case a firewall blocks the traffic)