Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
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. –  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
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? –  Karol Piczak May 13 '10 at 10:46
add comment

1 Answer

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 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 '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
add comment

Your Answer

 
discard

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.