[Dnsmasq-discuss] Is there a way to return names for DHCP clients?

B. Cook bcook at poughkeepsieschools.org
Sat Aug 23 14:04:18 BST 2008


Depending on your version of Linux, your dhclient might not send it's  
name when it asks for a lease.

You could take it's mac address and assign it a name as well.

so:
dhcp-host=00:11:22:33:44:55,sharkey

that way whatever ip that mac got it would always have the name  
sharkey (which seems like the point)

not sure what linux you have, but there is an excellent  
dnsmasq.conf.example that is heavily documented and has tons of great  
examples (hence the name)

You might also set these things in your .conf as well and then you can  
see what is going on in the dhcp 'process' (to some degree)
log-facility=/var/log/dnsmasq.log
log-dhcp
no-negcache

HTH


On Aug 22, 2008, at 5:27 PM, Grant Coady wrote:

> Hi there,
>
> My linux boxes all have static addresses, but dnsmasq is set to give
> DHCP address to 'casual' boxes, usually a friend's box over for a
> fixup, etc.
>
> Today I installed linux on a friend's box with DHCP lookup, but I
> cannot login by name:
>
> $ ssh sharkey
> ssh: Could not resolve hostname sharkey: Name or service not known
> grant at deltree:~/ip2c$ ssh 192.168.1.107
> ...
> grant at 192.168.1.107's password:
> Last login: Sat Aug 23 06:17:41 2008 from sillywin.mire.mine.nu
> Linux 2.6.24.5-smp.
> ...
>
> Is there a dnsmasq DHCP option to fix this?
>
> I have in server's /etc/dnsmasq.conf:
> ...
> #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
> =-=-=-=-
> # Section 2. DHCP Server
> # ```````````````````````
>
> domain=mire.mine.nu
> expand-hosts
> dhcp-authoritative
>
> dhcp-range=192.168.1.101,192.168.1.109,2h	<-- this gave the address
> dhcp-range=192.168.2.101,192.168.2.109,2h
>
> dhcp-host=magpie,192.168.1.31,8h		<-- windoze boxen
> dhcp-host=toshnt,192.168.1.35,8h
> dhcp-host=sillywin,192.168.1.36,8h
> dhcp-host=silly64,192.168.1.37,8h
> dhcp-host=tosh98,192.168.1.45,8h
>
> dhcp-option=42,0.0.0.0          # This box is NTP server
>
> # these are suggested for msft boxen:
> # FIXME check rfc2132 for other option
> #dhcp-option=19,0               # option ip-forwarding off
> #dhcp-option=36,1               # use 802.3 ethernet
> dhcp-option=44,0.0.0.0     # set netbios-over-TCP/IP nameserver(s)  
> aka WINS server(s)
> dhcp-option=45,0.0.0.0     # netbios datagram distribution server
> dhcp-option=46,8           # netbios node type
> dhcp-option=47             # empty netbios scope.
> #
> dhcp-lease-max=50
> # end
>
> The DHCP client looks correct:
> root at sharkey:/etc# cat /etc/resolv.conf
> # Generated by dhcpcd for interface eth0
> search mire.mine.nu
> nameserver 192.168.1.1
>
> Thanks,
> Grant.
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss



More information about the Dnsmasq-discuss mailing list