Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i should set up the following configuration with 2 machines: machine A issues HTTP requests machine B serves the pages requested by A

For testing purposes, i want that EVERY HTTP request issued by machine A gets served by machine B.

For example, machine A browser tries to access

machine B has a folder in its http server that has the content and replies to A.

How can I set up a dns on machine B to point ALL requests to itself?


share|improve this question
First of all, with DNS changes only you won't be able to selectively redirect all HTTP request (and leave other types of traffic alone). Second, what's your current setup - is B your current local DNS server for all the machines (A)? Is it a gateway/router? Your best bet would be probably to use some redirection at the firewall level. – Karol Piczak May 13 '10 at 10:20
hi karol, i'd like to redirect all traffic. machine A won't have internet access, it will only reach pages on machine B. B will be set up for this purpose alone and it is not a dns server yet. Should i reconsider my design? – mox601 May 13 '10 at 10:30
I think some transparent proxy could do in this case. Do you want to redirect every possible domain name this way, or some special subset you have? Failover to real Internet content when not available locally? And last thing - what operating system are we talking about? – Karol Piczak May 13 '10 at 10:46

Set up a BIND server on either machine following the settings given in my answer to this question.

Then just make sure that machine A's DNS settings point at that DNS server.

Note (as per @Karol's comment) that this will make all traffic from machine A hit machine B, not just HTTP traffic.

share|improve this answer
thanks, I'll try to do as you described. Yes, i just need all traffic redirected to machine B, that will serve files from its apache server. It is just for testing purposes, so it's not required a failover to the internet. I am running desktop ubuntu 10.04 – mox601 May 13 '10 at 15:03
I configured like you suggested and i see from the bind9 log on B that requests arrive from machine A. But as i do a dns lookup from A with dig i get a reply with status: SERVFAIL. i really can't figure out what's wrong, since i am a total newbie. – mox601 May 14 '10 at 10:17
check the BIND logs on server B to find out why it's returning that. It might be ACL related. – Alnitak May 14 '10 at 12:27

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.