LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how to resolve names to IPs WITHOUT /etc/hosts or DNS (https://www.linuxquestions.org/questions/linux-networking-3/how-to-resolve-names-to-ips-without-etc-hosts-or-dns-8606/)

iggymac 11-12-2001 12:56 AM

how to resolve names to IPs WITHOUT /etc/hosts or DNS
 
(This is somewhat similar to another thread I have going currently here. So my apologies.)

A windows user I know tells me that there is a way to resolve names to IP addresses on a private LAN without using a hosts file or setting up a DNS server (using only tcp/ip and not smb or other protocols).

Is this possible? He says it has to do with tcp/ip broadcasting, but to my limited knowledge tcp/ip has to use DNS to resolve names (or have a hosts file).

Is he talking about NetBios over tcp/ip and doesn't realize it? Or am I confused?

Thanks.

Stingreen 11-12-2001 08:39 AM

I'm not quite sure, but I guess WINS server works for this purpose on a private LAN.

lsof 11-12-2001 03:52 PM

wins as mentioned by Stingreen. or via a lmhosts file, if setting up a wins server is out of the question. :)

iggymac 11-12-2001 04:37 PM

Let me clarify:

How could you resolve names using tcp/ip ONLY and WITHOUT DNS or /etc/hosts files?

As in, how could you do this with Linux and Macs also?

Isn't WINS a Windows only, NetBios related thing?

Basically I have a Linux box and a Mac and have it set up with static ip's and using hosts files to resolve their names between themselves.

He tells me I can use broadcasting to do this if I want to switch to DHCP (I have a broadband router).

I say this cannot be done without a DNS server.

Does that make sense?

Thanks.

lsof 11-12-2001 04:57 PM

sorry about that iggymac

"Isn't WINS a Windows only, NetBios related thing?"
yes on a m$ lan for netbios -> ip resolution.

the only other thing that springs 2 my mind on a local lan is:
Address Resolution Protocol (ARP)

dangel 11-12-2001 04:58 PM

you r right iggy. you CAN'T do this in linux becuase it is a propietary protocol that windoze made. it works like this :
netbeui broadcasts a msg across the network screaming at the top of its lungs every 5 seconds "HEY!" "I'M OVER HERE!" "THIS IS MY IP AND ALL MY INFO" "I'LL EVEN GIVE YOU MY SHARED FILES"
lol
sorry. but its true. all you have to do is type in the unc and WHAM! your on their computer. hahaha
oh. so it has a password? use brute. el finisho.

imagine the bandwidth consumption on large network? think of older 10 mg hubs that don't seperate out the traffic between ports. blah! (alot of colleges still use this cause of $$ reasons)

hope this answers ur question.

b0b0 11-12-2001 06:10 PM

There is no way that I know of to have name resolution with out DNS/WINS/host files. WINS/NetBIOS is not just Microsoft. My Linux machines that use Samba register with my NT server's WINS database.

As for ARP...it resolves IP addresses to MAC addresses (that 12 character hex that is hardcoded into you NIC and other network appliances).

General rule of thumb...
1) If you just have a couple of host (>10) keep a host file (unless you want to learn something cool...BIND!!)
2) If you have more, use an internal DNS server.

Later and have fun,
jason

KevinJ 11-12-2001 09:30 PM

One of the previous posters is correct, Windows can use broadcasts to resolve hostnames.

Broadcasts are insecure, choke the network, and are not easily routed. However, they are not unique to Windows and are part of the SMB protocol standard and are therefore included with SAMBA.

Look in your SAMBA config file for a setting called "name resolve order". That is how you set the order in which SAMBA will attempt to resolve names. The "bcast" option is for broadcast.

Check the man pages for "nmblookup" for more info on testing this.

lsof 11-13-2001 01:19 AM

Quote:

Originally posted by KevinJ
Broadcasts are insecure, choke the network, and are not easily routed. However, they are not unique to Windows and are part of the SMB protocol standard and are therefore included with SAMBA.
maybe i am wrong about reading iggy's original post, isn't he asking if this can be done "(using only tcp/ip and not smb or other protocols)." :confused:

the main purpose of wins is to avoid broadcasts providing u'r clients use the wins server.

iggymac 11-13-2001 01:52 AM

Yes, I was trying to fiugure out how to do this with tcp/ip only.

In a nutshell I have a this:

Linux Box
Mac
Broadband Router

Was using DHCP on router but had to change to static IPs (which I didn't want to do) because I thought that without a DNS server running on the Linux Box I would have to use hosts files.

My friend said there was another way and I was trying to verify that.

Is there a way I could resolve my host names while using DHCP assigned IPs WITHOUT setting up a DNS server?

That's the real question. Sorry if I wasn't clear.

KevinJ 11-13-2001 07:33 AM

If you use SAMBA on the Linux box (I have no idea what you can do on a MAC) you can use the broadcast feature to resolve local hostnames.

If that option is not available on a Mac, then you will need DNS or Hosts. Those are the only options I know of.

iggymac 11-13-2001 10:32 PM

So it seems almost unanimous.

Without DNS or a protocol like SMB you cannot do name resolving with dynamic IPs.

Thanks all!


All times are GMT -5. The time now is 10:20 AM.