[Dnsmasq-discuss] Static IP client question

Chris Green cl at isbd.net
Sun Aug 7 16:07:16 BST 2016


On Sun, Aug 07, 2016 at 10:29:38AM -0400, Edward Crosby wrote:
>    On Sun, Aug 7, 2016 at 4:32 AM, Chris Green <[2]cl at isbd.net> wrote:
> > 
> >      On Sat, Aug 06, 2016 at 08:57:43PM -0400, Edward Crosby wrote:
> >      >    I've implemented Dnsmasq on a Raspberry Pi 3 running Ubuntu
> >      Mate 16.04
> >      >    on my home LAN. I have configured it as a DHCP server also. I
> >      have
> >      >    quite a few clients on my LAN, most of them are DHCP clients. I
> >      have
> >      >    one PC, my personal PC, that has a static IP address. This PC
> >      does not
> >      >    resolve host names of other host on my LAN, it doesn't even
> >      resolve the
> >      >    hostname of the Dnsmasq DNS server, even though I have the
> >      Dnsmasq
> >      >    server IP as my DNS server.
> >      I'm doing almost exactly the same as you.
> >      What I do is fix the IP address of my desktop machine by getting
> >      dnsmasq to always give it the same address.  So leave your desktop
> >      with a dynamic IP in its configuration and have something like the
> >      following to your /etc/hosts file on the pi:-
> >          127.0.0.1       localhost
> >          #
> >          #
> >          # These have fixed IP for various reasons, so dnsmasq serves
> >      their IP
> >          from here
> >          #
> >          192.168.1.1     vigor
> >          192.168.1.2     [3]pi.zbmc.eu raspberrypi  pi
> >          192.168.1.3     [4]esprimo.zbmc.eu [5]zbmc.eu
> >          192.168.1.5     maxinexp
> >          192.168.1.6     ben
> >          192.168.1.40    mikrotik
> >          192.168.1.60    fonera
> >      My desktop machine is esprimo.
>
>    So, in the /etc/dnsmasq.conf file configure the DHCP settings to always
>    give a specific IP address to my PC? Sort of like a reserved IP in
>    Windows DHCP server?
> 
You don't do it in /etc/dnsmasq.conf, you change /etc/hosts on the
machine where dnsmasq is running, as per my example above.  When the
machine esprimo (for example) asks for its IP, dnsmasq finds it in the
/etc/hosts file and gives it the IP specified there.  (At least that's
my understanding of how it works!)


-- 
Chris Green



More information about the Dnsmasq-discuss mailing list