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

We have a domain abc.com from which a particular page will display the contents from the domain def.com which does not belong to us. Now rather than display def.com in the address bar in the browser, we would like to continue using abc.com. We would like to achieve it without using iframes or screen scraping. Is there a way to achieve what we are after using DNS forwarding or aliasing? If so how? We have a choice of using Microsoft's DNS server or BIND.

share|improve this question

2 Answers 2

Set up a CNAME record to point to def.com.

share|improve this answer
    
How would that work? So if a user accesses the page residing on another domain i.e. they click on a link that reads www.def.com, how will the CNAME continue to show the domain www.abc.com bearing in mind that the domain www.abc.com displays content specific to it? –  PeanutsMonkey Jul 10 '12 at 20:10
    
I'm not sure I understand your question/scenario. A CNAME record will take www.def.com and mask it as www.abc.com so if a user browses to www.abc.com it will actually run a lookup for www.def.com but the URL will still be www.abc.com (depending on the browser). –  Brent Pabst Jul 10 '12 at 20:13
    
So let's say I am logged into www.abc.com. I click on a link that references www.def.com. What is the CNAME record set up as at this stage? Now if I click on the link, it pulls content from www.def.com. Assuming I interact with elements within www.def.com that have absolute references e.g. www.def.com/pagename.htm, will the address bar still display www.abc.com? –  PeanutsMonkey Jul 10 '12 at 20:17
    
If you click on a link for def.com you will get redirected to def.com there is no way to change DNS settings to handle that. You could theoretically setup a forwarder to it, but that will only work within your network. –  Brent Pabst Jul 10 '12 at 20:21
    
So there is no other way to cloak the URL or domain? –  PeanutsMonkey Jul 10 '12 at 21:16

Have you looked at the proxy capabilities of your web server? You may be able to proxy, and optionally cache the page.

DNS would only work if you can dedicate a domain to this page. As you don't control the domain a CNAME record would be the preferred choice. The site you are hiding may not be configured in a way that will support you using your own domain to access the page.

If you use DNS you are likely to run into problems. Any links on the page which specify the remote site will transfer your user to their site. Likewise any relative links on the page are likely to break, and won't lead back to your site. This can be mitigated if the site is hosting the page for you and are willing to set up a virtual server, and set the base for the page to your site.

EDIT: If your are running apache2 the following configuration would serve /page from the example.com server page /page. The response for requests for this URL will be served by fetching the page from example.com.

<IfModule mod_proxy.c>
    ProxyPass /page http://example.com/page
    <Proxy *>
       Order allow,deny
       Allow from all
    </Proxy>
</IfModule>

Proxy configuration is well documented in the Apache HTTP Server documentation. Caching is also documented there. Other servers have similar capabilities.

share|improve this answer
    
Could you elaborate on the proxying the pages? –  PeanutsMonkey Jul 11 '12 at 0:47
    
I would also add that nginx is designed to help with this and is lightweight. And no, I don't have any other information I can provide. –  Brent Pabst Jul 11 '12 at 13:52

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.