local network host name resolution

X

xane

Guest
Not just a jumble of search keywords.

Get ready ...

My home network involves a Linux Router/Firewall that also operates as a DHCP server, the Windows and FreeBSD machines get their local IP addresses from it and use it as a Gateway for internet.

Because the local IP addresses (192.168.x.x) are dynamically allocated, is there a way of referencing each of the local network machines by name rather than IP, a kind of "local DNS" as it were. I was assuming, with my limited knowledge of networking, that this would be a function of DHCP.

For example: assume "alpha" is my Linux DHCP and gateway machine, and "beta" and "delta" are Windows boxes, amd "gamma" is a FreeBSD box. How can I get "ping beta" to work on the FreeBSD "gamma" machine ?

As non-Windows machines are involved, I can't use WINS or NetBIOS trickery. I'm looking to avoid using static IPs and a hosts file for the name resolution, can anyone suggest another way ?

TIA
 
T

Testin da Cable

Guest
you will have to run DNS on a box with a reasonably static ip and have the DHCP server push that ip to the other boxes as resident nameserver.
 
T

Testin da Cable

Guest
wait...me stoopid maybe...

you want the names to stay the same, but the ip's to [possibly] change? that's tricky. in fact...off the top of my head I can't think of a way to do it...
 
T

Testin da Cable

Guest
there may be a funky way of getting the DHCP server to accept a local hostname, assigning an ip and then telling a DNS server about the localname <> ip relation but I can't imagine anyone bothering really. just give out statics heh.
 
X

xane

Guest
My line of thought is that the Router/Firewall is a gateway _and_ the DHCP server, so it (a) knows which hosts have which IPs, and (b) name resolution is passed through it anyway.

Could the Router/Firewall/DHCP machine run as a DNS as well, perhaps passing the unresolved name requests on to the ISP DNS ?
 
T

Testin da Cable

Guest
yes, you could do that. I do it. there are many documents about it, tis not hard to setup.
 
F

FUCKINGLAMENESS

Guest
This is very straightfoward using Dan J. Bernstein's djbdns (cr.yp.to) this perl script (thismetalsky.org).

You'll want to configure a local DNS using tinydns (available on your loopback IP), and a local caching resolver using dnscache (available on an address accessible by the rest of your network).

Configure all clients on your network to perform lookups via your caching resolver, and you can then configure dnscache to consult your local nameserver for the IP addresses / names of machines on your network.

Use the perl script above to update your local DNS with the names / addresses of machines as and when a lease is obtained.

It's also possible using BIND, but I prefer djbdns.
 
T

Testin da Cable

Guest
hmm that's nice. I'll play with that too. still, tbh I can't see why one would want dhcp on their home lan. "because I can" answers do not count!
 
X

xane

Guest
The main problem is the Linux Router/Firewall/DHCP machine is running a restricted version of RH (ipcop), most of the features have been removed for security reasons, adding new stuff is not something I am prepared to do, pity because I was actually looking forward to configuring a local DNS.

In the end I went to a static IP solution, and TBH, there are additional benefits I have discovered with this that make it better for me anyway, although I still don't like relying on a hosts file.

I also discovered that putting static IPs into Windows automatically engages the "NetBIOS over TCP/IP" option, so Windows machines can still see each other without the hosts file anyway, doesn't solve my FreeBSD machine tho.

Would there be a way of getting FreeBSD to use NetBIOS rather than hosts ? I know Samba has a WINS capacity, I might try this out.

Thanks everyone.
 
T

Testin da Cable

Guest
iirc turning samba on will do it for you, but I must say it's been ages since I've used it. might play a bit with it tonight too.
 
F

FUCKINGLAMENESS

Guest
Ideally you still want to set up an internal NS / caching resolver for your network. As you've taken away the added complexity of DHCP updates to your data file (by using static addresses), it's a trivial 10 minute job to configure.

djbdns makes doing this kind of thing very straightforward.

And it would be a perfect application for your FreeBSD box. :)
 
X

xane

Guest
After much tinkering last night I finally got Samba going, nice to see my FreeBSD machine appear in Network Neighbourhood and be able to map drives :)

Now I have the added bonus of the FreeBSD machine responding to NetBIOS calls, so I don't even need to use the hosts file.

As much as I'd like to take on the challenge of setting up a local DNS, the NetBIOS stuff handles it all for me now, plus I don't want to have the FreeBSD machine running all the time.

Thanks for suggestions, very helpful.
 
W

Wilier

Guest
I really want to be able to understand all of that stuff.
























but I cant. :(
 
D

danger

Guest
Originally posted by Wilier
I really want to be able to understand all of that stuff. but I cant. :(

LOL I know I read through that and I'm like.... yep DHCP.... yep dns this... yep static ironing board........ yep rotating woozle wazzle.... then I'm like come again......... it would be cool to understand everything there :)

what is DHCP ? that drew a complete blank :p
 
T

Testin da Cable

Guest
for those who have even less chance of understanding what an RFC is...DHCP stands for Dynamic Host Configuration Protocol. A DHCP server can tell your poota important stuff, like IPnumber, default route, nameservers(DNS) et al, as it boots and/or does a thing called a DHCPrequest.
DHCP helps you to run your lan very efficiently, because you can allocate resources out of a pool, as opposed to defining everything in a static fashion.
 
X

xane

Guest
Originally posted by Testin da Cable
cama aer teh geek0r!!!11_+

With nearly 20 years of IT experience harking back to the earlier days of UNIX System III, I have transcended geekdom and reside on a much higher/lower plane now, making origami figures out of my COBOL coding sheets.

I may be a geek, but I don't cling to old names like some dememted FORTRAN programmer.
 
F

FUCKINGLAMENESS

Guest
for those who have even less chance of understanding what an RFC is.

Hmm, from the Abstract:

The Dynamic Host Configuration Protocol (DHCP) provides a framework for passing configuration information to hosts on a TCPIP network.

That's not hard to understand, surely?
 

Users who are viewing this thread

Similar threads

H
Replies
9
Views
1K
FatBusinessman
F
P
Replies
12
Views
783
Deadmanwalking
D
F
Replies
1
Views
456
F
S
Replies
9
Views
615
Scouse
S
B
Replies
2
Views
645
old.MeddlE
O
Top Bottom