1

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 www.website.com/article.php?1234

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?

Thanks

3
  • 4
    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. May 13, 2010 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, 2010 at 10:30
  • 1
    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? May 13, 2010 at 10:46

1 Answer 1

1

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.

3
  • 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, 2010 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 www.anysite.com 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, 2010 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, 2010 at 12:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .