Re: [Dnsmasq-discuss] resolving server's hostname

2017-02-18 Thread Carl Karsten
On Sat, Feb 18, 2017 at 12:06 PM, Albert ARIBAUD 
wrote:

> Hi Carl,
>
> Le Sat, 18 Feb 2017 09:31:19 -0600
> Carl Karsten  a écrit:
>
> > dc10b is the dnsmasq server
>
> Ok; and I assume that you are running 'host' on another machine, right?
>

yes.
also running it on dc10b.



>
> > I am using a modified version of this:
> > https://anonscm.debian.org/git/debconf-video/ansible.git/
> tree/roles/dhcp-server
>
> Can't say it tells me much. :)
>
> > I haven't checked in the mods yet because things are still a little
> > wonky. git diff ... skimmed, don't see anything that would affect
> > dnsmasq.
> >
> > juser@dc10b:~$ cat /etc/dnsmasq.d/local.conf
> > ## Ansible managed
> >
> > interface=eth-local
> > domain=lca2017.lan
> > dhcp-range=10.20.1.10,10.20.1.254,6h
> > dhcp-option-force=210,/srv/tftp/
> > dhcp-boot=pxelinux.0
> > dhcp-authoritative
> > enable-tftp
> > tftp-root=/srv/tftp
>
> And what's the /etc/hosts?
>


juser@dc10b:~$ cat /etc/hosts
127.0.0.1localhost
127.0.1.1dc10b

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Note: that is current.  I have been changing the dc10b line, but it should
be clear in my posts what it is when I show test results.


>
> > Hmm, on an openwtt ap running dnsmasq:
> >
> > root@tpap:~# cat /etc/resolv.conf
> > search lan
> > nameserver 127.0.0.1
> >
> > root@tpap:~# cat /etc/hosts
> > 127.0.0.1 localhost
> >
> > root@tpap:~# nslookup tpap
> > Server:127.0.0.1
> > Address 1: 127.0.0.1 localhost
> > Name:  tpap
> > Address 1: 192.168.1.2 tpap.lan
>
> What's 'tpap' supposed to be?
>
>
192.168.1.2

so this install does what I would expect.



> Anyway, my guess: your dnsmasq server has its own name listed in
> its /etc/hosts with 127.0.1.1 as the matching IP,


correct



> and your dnsmasq
> config does not contain option no-hosts,


correct


> so your dnsmasq uses
> its /etc/hosts when resolving a name; ergo, it resolves its own name to
> 127.0.1.1.
>

correct


so if I set no-hosts, how does dnsmaq figure out how to resolve dc10b?

ore really, what should I be doing so that 'things work as I expect' ?



>
> Amicalement,
> --
> Albert.
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] resolving server's hostname

2017-02-18 Thread Albert ARIBAUD
Hi Carl,

Le Sat, 18 Feb 2017 09:31:19 -0600
Carl Karsten  a écrit:

> dc10b is the dnsmasq server

Ok; and I assume that you are running 'host' on another machine, right?

> I am using a modified version of this:
> https://anonscm.debian.org/git/debconf-video/ansible.git/tree/roles/dhcp-server

Can't say it tells me much. :)

> I haven't checked in the mods yet because things are still a little
> wonky. git diff ... skimmed, don't see anything that would affect
> dnsmasq.
> 
> juser@dc10b:~$ cat /etc/dnsmasq.d/local.conf
> ## Ansible managed
> 
> interface=eth-local
> domain=lca2017.lan
> dhcp-range=10.20.1.10,10.20.1.254,6h
> dhcp-option-force=210,/srv/tftp/
> dhcp-boot=pxelinux.0
> dhcp-authoritative
> enable-tftp
> tftp-root=/srv/tftp

And what's the /etc/hosts?

> Hmm, on an openwtt ap running dnsmasq:
> 
> root@tpap:~# cat /etc/resolv.conf
> search lan
> nameserver 127.0.0.1
> 
> root@tpap:~# cat /etc/hosts
> 127.0.0.1 localhost
> 
> root@tpap:~# nslookup tpap
> Server:127.0.0.1
> Address 1: 127.0.0.1 localhost
> Name:  tpap
> Address 1: 192.168.1.2 tpap.lan

What's 'tpap' supposed to be?

Anyway, my guess: your dnsmasq server has its own name listed in
its /etc/hosts with 127.0.1.1 as the matching IP, and your dnsmasq
config does not contain option no-hosts, so your dnsmasq uses
its /etc/hosts when resolving a name; ergo, it resolves its own name to
127.0.1.1.

Amicalement,
-- 
Albert.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] resolving server's hostname

2017-02-18 Thread Carl Karsten
dc10b is the dnsmasq server

I am using a modified version of this:
https://anonscm.debian.org/git/debconf-video/ansible.git/tree/roles/dhcp-server

I haven't checked in the mods yet because things are still a little wonky.
git diff ... skimmed, don't see anything that would affect dnsmasq.

juser@dc10b:~$ cat /etc/dnsmasq.d/local.conf
## Ansible managed

interface=eth-local
domain=lca2017.lan
dhcp-range=10.20.1.10,10.20.1.254,6h
dhcp-option-force=210,/srv/tftp/
dhcp-boot=pxelinux.0
dhcp-authoritative
enable-tftp
tftp-root=/srv/tftp


Hmm, on an openwtt ap running dnsmasq:

root@tpap:~# cat /etc/resolv.conf
search lan
nameserver 127.0.0.1

root@tpap:~# cat /etc/hosts
127.0.0.1 localhost

root@tpap:~# nslookup tpap
Server:127.0.0.1
Address 1: 127.0.0.1 localhost
Name:  tpap
Address 1: 192.168.1.2 tpap.lan






On Sat, Feb 18, 2017 at 6:15 AM, Albert ARIBAUD 
wrote:

> Hi Carl,
>
> Le Fri, 17 Feb 2017 02:06:16 -0600
> Carl Karsten  a écrit:
>
> > juser@dc10b:~$ host dc10b
> > dc10b has address 127.0.1.1
> >
> > It should be 10.20.1.3
> >
> > How do I make that happen?
>
> Hmm... Can you elaborate on the context of your problem? This does not
> happen to me -- my machine even has an entry in its own /etc/hosts with
> its name tied to 127.0.0.1 but a host or dig will return its LAN
> address.
>
> Amicalement,
> --
> Albert.
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] resolving server's hostname

2017-02-18 Thread Albert ARIBAUD
Hi Carl,

Le Fri, 17 Feb 2017 02:06:16 -0600
Carl Karsten  a écrit:

> juser@dc10b:~$ host dc10b
> dc10b has address 127.0.1.1
> 
> It should be 10.20.1.3
> 
> How do I make that happen?

Hmm... Can you elaborate on the context of your problem? This does not
happen to me -- my machine even has an entry in its own /etc/hosts with
its name tied to 127.0.0.1 but a host or dig will return its LAN
address.

Amicalement,
-- 
Albert.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss