# how to make every machine's hostname to be seen everywhere

## carbon

i have a DSL connection, which connects to the DSL modem , and then to my router.

under the router is my gentoo box (compA) and a switch

under my switch is my windows box(compB)  and my gentoo laptop (compC)

you know in IE you can do \\hostname and get to the machine and have a look at the shared stuff, right? so i wanna be able to reach everywhere on my LAN quickly.

do i need an internal DNS to do this?

----------

## Pythonhead

Are you just not able to resolve any hosts in your lan or do you need software on Linux to access the Windows machines, like Samba?

----------

## carbon

i am not able to do either, cant resolve hostname within my lan, cant get to my server's file thru IE. i want to reach my file on my gentoo box from my IE by doing the \\hostname thing. is it possible?

----------

## nbg

Yes.

For the hostnames, you can go about doing this in two ways. Setting up a DNS server, or putting the entries in /etc/hosts. The latter would probably work best for you.

For SMB shares, you'll need the samba client. Also, keep in mind that BASH uses the backslash as an internal character, so you need two of them \\computer\share in Windows would be \\\\computer\\share in BASH. If you want to do it from a browser, Konqueror and (I believe) Nautilus can be compiled with SMB support.

----------

## carbon

i wanna map a network drive , so i can synchronize what i see in windows with the stuff i have in the gentoo server.

my gentoo's hostname is say foo

when i type \\foo, it wont regonize it.

so i need an internal DNS?

----------

## splooge

 *nbg wrote:*   

> Yes.
> 
> For the hostnames, you can go about doing this in two ways. Setting up a DNS server, or putting the entries in /etc/hosts. The latter would probably work best for you.
> 
> For SMB shares, you'll need the samba client. 

 

----------

## carbon

putting that in etc/hosts wont make my windows box to be able to see the gentoo box, would it?

----------

## splooge

If you put it in your windows hosts file it will.

----------

## carbon

where is my windows hosts file?  :Surprised:   :Surprised: 

----------

## Chris W

In the Windows directory.  The location varies between Windows variants, so it is best to search for it.

By default there is no hosts file, just a hosts.sam (sample) file.  Copy to hosts in the same directory and edit to suit.

----------

## antik

 *carbon wrote:*   

> where is my windows hosts file?  

 

w2k: \WINNT\system32\drivers\etc\hosts

#hosts file

127.0.0.1       localhost

192.168.0.1   router

192.168.0.2   gentoobox

192.168.0.3   freebsd

copy this file to all windows and *nix hosts.

----------

## madchaz

use samba to see files in Windows that are on your gentoo box using explorer (not internet explorer  :Wink:  )

```
emerge samba
```

```
nano /etc/samba/smb.conf
```

```
rc-update add samba default
```

```
/etc/init.d/samba start
```

you're good to go for sharing. 

As for host name resolution, either adding all the machine names in all your host files or using a simple dns service like dnsmasq works. 

Personaly, I use dnsmasq because that way I don't have to do it on all the machines, I just point them to the server. Then all you have to do is make sure all your machines/ip pairs are in the host file on the machine with dnsmasq.

----------

## carbon

i have edited the hosts in my windows box

but \\gentoobox still wont get me anything

i can use ftp://192.168.0.x to get to the machine and see what i wanted to get, say a movie, then if i wanna play it, it appears to be downloading the whole movie before playing it, can i make it to work like a real time streaming from a distant server (buffering 128kps?) ?

----------

## PowerFactor

Your problem appears to be that you still don't have the samba server set up correctly on the gentoo box.  The hosts file will help you with ftp and http but it has nothing to do with being able to access the gentoo box with \\gentoobox, that's all windows networking.

Setting up the samba server is a little more complicated than madchaz mentioned, it's not bad though.  Swat is quite helpful in that area.  Search the forums and www.samba.org  for info on setting it up.

----------

## carbon

i see, so you need a samba server to listen?

----------

## PowerFactor

Yep.  I forgot to mention there is short section on setting up a very basic samba setup in the desktop guide.

----------

## christsong84

\\servername is WINS resolution...not really so much DNS...just thought I'd point it out  :Wink: 

----------

## PowerFactor

 *christsong84 wrote:*   

> \\servername is WINS resolution...not really so much DNS...just thought I'd point it out 

 It's not even necessarily WINS, netbois naming has been around longer than WINS.  And a WINS server isn't required on most basic windows networks.

----------

## christsong84

WINS is generally required for a linux box to be recognized as only the nmbd process does netbios naming...the smbd doesn't.  (A WINS server is built-in to every samba...just needs to be enabled...)

----------

## PowerFactor

I've never enabled WINS support on any of my samba boxes, and they work fine.  I don't have a WINS server on my network either.  Yes the nmbd process is what handles the name resolution. But you don't need to enable WINS support for it to work.  It generally works through netbios name broadcasts.   WINS operates more like dns, and is only necessary to get netbios name resolution across routers on large networks.

This is really getting OT.  :Wink: 

----------

## christsong84

heh...sorry for hijacking the thread...I don't mean to but it happens to me it seems...

btw: if it's any consolation...My Samba works using the xfsamba util...linux boxes can see hostnames out...but windows can't see me (yes i opened the proper ports in my firewall)

carbon: streaming usually means a server and a compatible player to stream it to/from...might want to look around...not sure but icecast looked good when I last looked at it (about a year ago...)

----------

## carbon

i got it working,

last question

how to make IE to regonize symbolic link under ftp protocol?

----------

