Discussion:
[Dnsmasq-discuss] Static IP client question
Edward Crosby
2016-08-07 00:57:43 UTC
Permalink
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 am coming from the Windows world where I have worked with Windows server
running the role of DHCP and DNS server. In that world if a client is
assigned a static IP, as long it is has the DNS server assigned as its DNS
server it can resolve other host on the LAN. I'm finding that to not be the
case with Dnsmasq, unless I am doing something wrong.
When Dnsmasq is configured as the DHCP server does it somehow create host
records on the server when a client receives an IP from the server and
registers it hostname? If so, where are these records located? Also, why
can't my PC with a static IP not resolve hostnames on the LAN when it is
still using the Dnsmasq server as its DNS server?

----------------------------------------
Have a Better One,
Edward Crosby
http://about.me/edwardcrosby
Chris Green
2016-08-07 08:32:47 UTC
Permalink
Post by Edward Crosby
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 pi.zbmc.eu raspberrypi pi
192.168.1.3 esprimo.zbmc.eu 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.
--
Chris Green
Edward Crosby
2016-08-07 14:29:38 UTC
Permalink
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?

----------------------------------------
Have a Better One,
Edward Crosby
http://about.me/edwardcrosby
Post by Chris Green
Post by Edward Crosby
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
Post by Edward Crosby
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 pi.zbmc.eu raspberrypi pi
192.168.1.3 esprimo.zbmc.eu 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.
--
Chris Green
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Chris Green
2016-08-07 15:07:16 UTC
Permalink
Post by Edward Crosby
Post by Edward Crosby
Post by Edward Crosby
I've implemented Dnsmasq on a Raspberry Pi 3 running Ubuntu
Mate 16.04
Post by Edward Crosby
on my home LAN. I have configured it as a DHCP server also. I
have
Post by Edward Crosby
quite a few clients on my LAN, most of them are DHCP clients. I
have
Post by Edward Crosby
one PC, my personal PC, that has a static IP address. This PC
does not
Post by Edward Crosby
resolve host names of other host on my LAN, it doesn't even
resolve the
Post by Edward Crosby
hostname of the Dnsmasq DNS server, even though I have the
Dnsmasq
Post by Edward Crosby
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
w***@gmail.com
2016-08-07 15:19:33 UTC
Permalink
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?
it is called psuedo-static because it is static handed out by dhcp based on the
MAC address... it is a trick some ISPs use when they sell you a static IP for
$100US a year and it takes less than 2 minutes to put in the configuration...
you have to remember, though, that if you change your NIC, you have to adjust
the dhcp configuration for the new MAC, too...


we use psuedo-static here on all our systems... it makes it much easier to
control when/if any network address renumbering has to be done... change the
assigned IP numbers and let the lease expirations take care of the systems
getting their new numbers... then maybe go around later and deal with shared
resources that are using IP numbers instead of host names ;)
--
NOTE: No off-list assistance is given without prior approval.
*Please keep mailing list traffic on the list* unless
private contact is specifically requested and granted.
Chris Green
2016-08-07 15:36:11 UTC
Permalink
Post by Chris Green
Post by Edward Crosby
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 pi.zbmc.eu raspberrypi pi
192.168.1.3 esprimo.zbmc.eu 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.
Hi Chris and Edward,
I don't have many Windows machines around my dnsmasq managed,
statically attributed LAN, but at least one is used daily, and I just
How did you (both) test that the machine does not resolve?
I've tested the following with a Windows machine (let's call it romulus)
and my Linux machine (let's call it remus). From the command prompt on
ping remus
=> romulus complains that it could not find host remus.
nslookup remus
=> This resolves immediately to remus' fixed IP address.
ping remus. (note the dot at the end!)
=> This works.
If I'd believed the first ping, I might have concluded that the
resolution did not work, while it actually does; the issue is with
how romulus handles domainless names.
Hence my question re: how exactly the issue was tested.
I've not used nslookup in years, it's deprecated now. I use 'host' or
'dig' if something else doesn't work (e.g. an ssh to somewhere).

I'm not sure why you get the symptoms you're seeing though Albert, I
don't think I've ever noticed anything like that. If I try 'ssh
something' and it doesn't work then 'host something' doesn't work
either! :-)
--
Chris Green
Albert ARIBAUD
2016-08-09 17:16:06 UTC
Permalink
Hi Chris,

Le Sun, 7 Aug 2016 16:36:11 +0100
Post by Chris Green
Post by Chris Green
Post by Edward Crosby
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 pi.zbmc.eu raspberrypi pi
192.168.1.3 esprimo.zbmc.eu 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.
Hi Chris and Edward,
I don't have many Windows machines around my dnsmasq managed,
statically attributed LAN, but at least one is used daily, and I
How did you (both) test that the machine does not resolve?
I've tested the following with a Windows machine (let's call it
romulus) and my Linux machine (let's call it remus). From the
ping remus
=> romulus complains that it could not find host remus.
nslookup remus
=> This resolves immediately to remus' fixed IP address.
ping remus. (note the dot at the end!)
=> This works.
If I'd believed the first ping, I might have concluded that the
resolution did not work, while it actually does; the issue is with
how romulus handles domainless names.
Hence my question re: how exactly the issue was tested.
I've not used nslookup in years, it's deprecated now. I use 'host' or
'dig' if something else doesn't work (e.g. an ssh to somewhere).
I'd use dig if that were provided on Windows machines. :)
Post by Chris Green
I'm not sure why you get the symptoms you're seeing though Albert, I
don't think I've ever noticed anything like that. If I try 'ssh
something' and it doesn't work then 'host something' doesn't work
either! :-)
I'm not sure why you think I am seeing symptoms here :) -- as far as
I'm concerned, the Windows machines on my network work fine [enough for
their users]. I am just giving an example to show that depending on how
one tests things, one may get to a wrong conclusion, and therefore,
that explaining how one runs a test is as important as running it.

Amicalement,
--
Albert.
Continue reading on narkive:
Loading...