Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it possible to lure a website from the web server without relying on DNS records? Windows IIS WebServer was working with headers, Linux is working with virtual server names etc.

Imagine this situation:

  • Server (linux + apache) directly accessible from the internet with his own IP ( With default page like: "It's working!"
  • In Apache(httpd) a Virtual server is set like: server name: , listening to any address default port.
  • I don't have DNS record saying like: - M ->
  • I don't have my own DNS server set up and dont want to route sites on different ports.

How can I access stored websites with only IP address and known hosted site name?

share|improve this question

migrated from Jun 14 '11 at 16:27

This question came from our site for professional and enthusiast programmers.

4 Answers 4

I would advice against changing your /etc/hosts or setting up local DNS servers.
You will run into caching issues, forget to disable it, etc. Use curl:

curl -H""

Or if you want to see the content rendered, use a Firefox Plugin (
Livehttpheaders allows you to change any header and "replay" them.
Change the Host header and it does what you want.

share|improve this answer

Edit your local hosts file.

In Linux it's on:


For windows it should be


Check that reference wikipedia page to find yours.

This will act as a local-only DNS for your development workstation, add # before the lines when you want to comment a line (when DNS will be active).

Edit: You can of course have several names for the same IP, this way:

or this way:
share|improve this answer

Check the Dnsmasq program, which could be used as an effective local DNS cache.

Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP server.


Dnsmasq provides the following features:

  • The DNS configuration of machines behind the firewall is simple and doesn't depend on the details of the ISP's dns servers


You can find a nice tutorial on how-to use dnsmasq as local DNS cache here.

share|improve this answer

As I understand you want to type IP address in browser and access web server that runs there (e.g.

If so -- Yes, you can do it but, obviously, it will be one site per IP:port combination.

I cannot really tell you how this can be done on Apache (don't have much experience configuring it) but for Microsoft IIS 7.x it can be done in this way:

1) Select the site entry and bring "Site Bindings" dialogue.

2) Type, IP address & port number -- select desired settings; Host name -- leave blank

3) Save settings and try the results. If does not work then you must be done something wrong (or such binding already exists).

Microsoft IIS 6 can be configured in a similar way -- just different path/buttons to press.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.