View previous topic :: View next topic |
Author |
Message |
neil_leathers n00b
Joined: 04 Feb 2010 Posts: 20
|
Posted: Wed Oct 27, 2010 5:15 pm Post subject: Use DHCP for dynamic IPs and need hostname to resolve |
|
|
My machines are behind a NAT box and have dynamic IPs served by DHCP for the internal network. I don't have DNS setup for the internal network (non-authoritative, not needed) so I need to set the hostname to resolve to the provided IP. What configuration options do I use to make my DHPC client do this? (For the moment, in order to compile dev-lang/python I have to put an entry into /etc/hosts.)
I have seen various posts in the forums almost on the subject but I didn't see one on this configuration (though I may have missed it).
I have a hostname set in /etc/conf.d/hostname (but can delete it if necessary)
I use net-misc/dhcpcd-4.0.15 to get an IP (it seems the least broken of the DHCP clients I have tried)
The DHCP server does not put the assigned IP into a DNS (and probably should not)
The IP address received must be dynamic (since the network is dynamic)
The host names must resolve locally |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9882 Location: almost Mile High in the USA
|
Posted: Wed Oct 27, 2010 7:23 pm Post subject: |
|
|
I've used net-dns/dnsmasq with some luck. This does pretty much everything - DHCP and DNS, keeps a local table of DHCP addresses with symbolic names that resolves with its own local DNS cache. DD-WRT uses this to do local-only DNS lookups of "locally static" IPs. Might want to check this out if you have your roll-your-own router/DNS/DHCP.
Or if you are using DD-WRT - use it to its full potential! _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
neil_leathers n00b
Joined: 04 Feb 2010 Posts: 20
|
Posted: Wed Oct 27, 2010 9:01 pm Post subject: |
|
|
eccerr0r wrote: | I've used net-dns/dnsmasq with some luck. This does pretty much everything - DHCP and DNS, keeps a local table of DHCP addresses with symbolic names that resolves with its own local DNS cache. DD-WRT uses this to do local-only DNS lookups of "locally static" IPs. Might want to check this out if you have your roll-your-own router/DNS/DHCP. |
I'll consider it for the future since I've been thinking about moving to a roll-your-own router setup. Unfortunately I currently don't and am therefore looking at fixing this on the client end. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9882 Location: almost Mile High in the USA
|
Posted: Wed Oct 27, 2010 11:57 pm Post subject: |
|
|
Not exactly sure what you want to do here now... If you have no local DNS, it will never resolve to anything anyway (unless you want to select something in your hosts file? but why?), might well just leave it as a default name?
You get a lease from DHCP, your IP address gets configured onto your ethernet, so now you can use the network... I'm not sure why you need to set your hostname now? It should work without hostname set, unless there's something I'm missing? _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
cyrillic Watchman
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Thu Oct 28, 2010 1:03 am Post subject: |
|
|
If you are looking for local DNS without a DNS server, multicast DNS is the next best thing.
Try net-dns/avahi with sys-auth/nss-mdns,
or net-misc/mDNSResponder.
... then have fun reading the instructions |
|
Back to top |
|
|
|