Wednesday, January 26, 2011

How to get the same result as modifying /etc/hosts file, without root access?

The question is simple: no root access, but need to point particular domain name to the specified IP address.

What are the other ways to do the same thing as with adding the record to /etc/hosts file?

UPDATE:

Clarification:
My domain had been expired, but I still want to gain the access to it from corporate network (no root privileges on my linux workstation) by it's domain name for: http, https, imaps, smtps, ftp, and couple of specific ports.

  • You could LD_PRELOAD in your own versions of gethostby{addr,name..} which read /etc/hosts and then the users own hosts file in their homedirectory.

    Kyle Brandt : +1 Have to remember this for the next time April 1st rolls around :-)
    From rkthkr
  • The server is using a nameserver right ? (cat /etc/resolv.conf) so you could, if you have access, configure it to return a specific IP address for a particular domain.

    apenwarr : If he had root access to change /etc/resolv.conf, then he could change /etc/hosts too.
    From Marcel

0 comments:

Post a Comment