Networking Forums

Networking Forums > Computer Networking > Linux Networking > User specific "/etc/hosts" ?

Reply
Thread Tools Display Modes

User specific "/etc/hosts" ?

 
 
howa
Guest
Posts: n/a

 
      11-21-2006, 06:12 AM
rather than the main /etc/hosts

can each user has their own version of file?

thanks.

 
Reply With Quote
 
 
 
 
Robert Harris
Guest
Posts: n/a

 
      11-21-2006, 10:44 AM
howa wrote:
> rather than the main /etc/hosts
>
> can each user has their own version of file?
>
> thanks.
>

No.
 
Reply With Quote
 
C.J. Steele
Guest
Posts: n/a

 
      11-21-2006, 10:57 AM
You can set each user's HOSTFILE individually by adjusting the (at
least in bash) HOSTFILE variable... so, in your global shell rc file,
for example if everyone is using bash, just put the following in your
/etc/bashrc:

export HOSTFILE=/etc/hosts.d/hosts.$USER

and then make sure that you wrap the adduser-script accordingly so it
automagically creates a default /etc/hosts.d/hosts.$USER file for every
new user.

similar accommodations could be made for other shells, I believe.

-C

On Nov 21, 1:12 am, "howa" <howac...@gmail.com> wrote:
> rather than the main /etc/hosts
>
> can each user has their own version of file?
>
> thanks.


 
Reply With Quote
 
Robert Harris
Guest
Posts: n/a

 
      11-21-2006, 11:48 AM
C.J. Steele wrote:
> You can set each user's HOSTFILE individually by adjusting the (at
> least in bash) HOSTFILE variable... so, in your global shell rc file,
> for example if everyone is using bash, just put the following in your
> /etc/bashrc:
>
> export HOSTFILE=/etc/hosts.d/hosts.$USER
>
> and then make sure that you wrap the adduser-script accordingly so it
> automagically creates a default /etc/hosts.d/hosts.$USER file for every
> new user.
>
> similar accommodations could be made for other shells, I believe.
>
> -C


HOSTFILE will modify bash hostname completions but it won't alter the
behaviour of gethostbyname and gethostbyaddr functions that are used to
translate between host names and IP addresses.

Robert

>
> On Nov 21, 1:12 am, "howa" <howac...@gmail.com> wrote:
>> rather than the main /etc/hosts
>>
>> can each user has their own version of file?
>>
>> thanks.

>

 
Reply With Quote
 
Joachim Mæland
Guest
Posts: n/a

 
      11-21-2006, 05:06 PM
On Mon, 20 Nov 2006 23:12:07 -0800, howa wrote:

> rather than the main /etc/hosts
>
> can each user has their own version of file?


Looks like you're asking your question based the assumption that you've
found the solution... What's the problem? What are you trying to
accomplish, and why?

--
Regards/mvh Joachim Mæland

If everything seems under control, you're just not going fast enough.
-Mario Andretti.

 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      11-22-2006, 04:06 PM

howa wrote:
> rather than the main /etc/hosts
>
> can each user has their own version of file?
>
> thanks.


No, but you can likely achieve whatever result you're trying to
achieve. Linux gives you a lot of control over applications that do
things the normal way. (But there may be little to nothing you can do
about applications that do things their own way.)

DS

 
Reply With Quote
 
howa
Guest
Posts: n/a

 
      11-22-2006, 04:39 PM

David Schwartz ¼g¹D¡G

> howa wrote:
> > rather than the main /etc/hosts
> >
> > can each user has their own version of file?
> >
> > thanks.

>
> No, but you can likely achieve whatever result you're trying to
> achieve. Linux gives you a lot of control over applications that do
> things the normal way. (But there may be little to nothing you can do
> about applications that do things their own way.)
>
> DS


well, for example, i need to get file using wget
http://www.mycompany.com

but i mycomapny.com cannot be allowed to define in /etc/hosts, what can
i do?

 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      11-22-2006, 04:41 PM
On 22 Nov 2006 09:39:21 -0800, howa wrote:
> well, for example, i need to get file using wget
> http://www.mycompany.com
>
> but i mycomapny.com cannot be allowed to define in /etc/hosts, what can
> i do?


use ip address of mycompany.com instead of mycompany.com
 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      11-22-2006, 04:57 PM
"howa" <(E-Mail Removed)> writes:


>David Schwartz =BCg=B9D=A1G


>> howa wrote:
>> > rather than the main /etc/hosts
>> >
>> > can each user has their own version of file?
>> >
>> > thanks.

>>
>> No, but you can likely achieve whatever result you're trying to
>> achieve. Linux gives you a lot of control over applications that do
>> things the normal way. (But there may be little to nothing you can do
>> about applications that do things their own way.)
>>
>> DS


>well, for example, i need to get file using wget
>http://www.mycompany.com


use the IP address.

http://111.222.333.44


>but i mycomapny.com cannot be allowed to define in /etc/hosts, what can
>i do?


Why not? And why is www.mycompany.com not in the dns tables?



 
Reply With Quote
 
Giovanni
Guest
Posts: n/a

 
      11-22-2006, 05:11 PM
Unruh wrote:
> "howa" <(E-Mail Removed)> writes:
>
>
>> David Schwartz =BCg=B9D=A1G

>
>>> howa wrote:
>>>> rather than the main /etc/hosts
>>>>
>>>> can each user has their own version of file?
>>>>
>>>> thanks.
>>> No, but you can likely achieve whatever result you're trying to
>>> achieve. Linux gives you a lot of control over applications that do
>>> things the normal way. (But there may be little to nothing you can do
>>> about applications that do things their own way.)
>>>
>>> DS

>
>> well, for example, i need to get file using wget
>> http://www.mycompany.com

>
> use the IP address.
>
> http://111.222.333.44
>
>
>> but i mycomapny.com cannot be allowed to define in /etc/hosts, what can
>> i do?

>
> Why not? And why is www.mycompany.com not in the dns tables?


Maybe he does not have internet access ;-)

--
A computer is like an air conditioner,
it stops working when you open Windows.
Registered Linux user #337974 < http://giovanni.homelinux.net/ >
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to start "Routing and Remote Access" due to an specific err Jhon Diaz Windows Networking 1 11-15-2008 01:35 PM
[Fwd: SPEWS DOLTS "SneakyP", "Kevin!:?)", "WindsorFox" SPAM braodbandnewsgroup] !:?) Broadband 0 11-30-2005 01:04 AM
Re: SPEWS SLIMES "WindsorFox", "Kevin-!:?)", "Spin Dryer" get the cold shoulder at broadband ng! SneakyP Broadband 0 11-29-2005 10:46 PM
Attention Plus.net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM broadband newsgroup !:?) Broadband 0 11-28-2005 04:28 AM
Attention Plus.Net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM braodband newsgroup !:?) Broadband 0 11-28-2005 03:03 AM



1 2 3 4 5 6 7 8 9 10 11