How to redirect a URL to a certain IP, as with /etc/hosts?

1

Someone on my shared server has messed with some setting such that gethostbyname('www.google.com') (PHP) gives me the IP for his website, rather than Google. I believe this can be done via the /etc/hosts file, but presumably, he doesn't have access to that file (unless my server administrator really screwed up). Anyway, I need to find a way to explain this to the 'techies' that run my server so that they can correct the issue and revoke such access.

Is there another way someone could have messed with these settings? Something akin to a .htaccess file perhaps? How do I explain the issue so it can be resolved? I don't think I have the power to fix this myself.

mpen

Posted 2012-08-14T04:24:47.890

Reputation: 9 109

Have you actually checked /etc/hosts ? It would be the logical place for it. Otherwise, the DNS server the machine is using. – Paul – 2012-08-14T04:36:47.810

@Paul: As I mentioned, I'm on a shared server. I presently can't even get into the shell, or I'd check if I could access it. The DNS server could only be modified by my host, no? Presumably another shared user couldn't tamper with that? I'm fairly certain another shared user did this, somehow. I'm trying to figure out what they did. – mpen – 2012-08-14T04:38:05.567

Well, I've called tech support to no avail. I'm trying to get Google Recaptcha working, and it sends a request to www.google.com but the response I get back isn't from Google, it's from another site on the shared server, so my only guess is that he's somehow remapped that to point to his site, and I don't know how to fix it. I'm guessing he's messed with some setting, and I need to find a way to properly communicate this to the people that run my shared server so that they can fix it for me and revoke such access from shared users. – mpen – 2012-08-14T05:08:43.047

2Ah, if this is a shared server, and it supports adding additional domains, and isn't properly configured, then it could be that one of the other users has added google.com as a domain. – Paul – 2012-08-14T05:19:26.430

@Paul: Oh, clever! I never thought about what actually happens when you add a domain through that control panel. I'll ask the admins if that's the case; should be an easy fix. – mpen – 2012-08-14T15:29:32.473

No answers