DNS not working as expected


#1

Hello again,
I have a another question about nethserver.
I have activated DHCP and DNS Server on my nethserver but something is not working as expected.

If a client gets an ip-address and is registered at dhcp, no DNS record is created.
Clients will be registered with names like host-cdfc564d instead of there real hostnames.

What do I have todo to get this working?

Thank you!


#3

This should be done automatically. I don’t want to add all my devices.


(Artem Fedai) #4

I cannot be done because you can not predict MAC from your Lan.


#5

The dhcp server knows the MAC address and should register name and IP.


(Artem Fedai) #7

Name of the host that you specify should be given.


#8

Sorry it didn’t work for me.

My main problem is my linux fat client is not resolved properly. Android and iphone are resolved fine but linux client won’t. Also a ping on ping host-be72b1a3 results in ping: unknown host host-be72b1a3

I did an tcpdump as you can see NXDomain is replied.
23:21:55.977521 IP 192.168.10.37.37325 > 192.168.10.250.domain: 1211+ PTR? 37.10.168.192.in-addr.arpa. (44)
23:21:55.978782 IP 192.168.10.250.domain > 192.168.10.37.37325: 1211 NXDomain* 0/1/0 (106)

I think the problem is here(/var/lib/dnsmasq/dnsmasq.leases):
1452638401 cc:c3:ea:23:01:b7 192.168.10.23 android-fb5ae23fe5057561 01:cc:c3:ea:23:01:b7
1452637017 00:15:c5:c4:37:76 192.168.10.37 * *
1452635554 b0:9f:ba:c0:5a:bd 192.168.10.26 Iphone5c 01:b0:9f:ba:c0:5a:bd
1452636230 e4:f8:ef:75:4e:bf 192.168.10.44 android-3109543bb3be96d0 01:e4:f8:ef:75:4e:bf
1452637010 00:19:d2:02:94:f7 192.168.10.76 * *

But why are there 2 stars instead of the hostname?


(Filippo Carletti) #9

Maybe your linux pc isn’t sending hostname. See for example Fedora:
http://possiblelossofprecision.net/?p=1377


(Artem Fedai) #10

@Linux4All have you tried patch? And restart dnsmasq?


#11

@filippo_carletti: I think exactly that is my problem. I did some tests in the meantime and a dhclient -H testname eth0 works fine

So I will try to find out the setting for my opensuse. I think it is in /etc/sysconfig/dhcp


#13

Got it. opensuse is using network manager.
Therefor you have to go to /etc/NetworkManager/system-connections/
Edit your configfile

Add the following lines at section [ipv4]

dhcp-hostname=masterhost
dhcp-send-hostname=true

@Nas many thanks for your help. I will test this for my android devices.


(Artem Fedai) #14

my patch it is for that if you want to specify hard name - ip address, even if pc does not response his name.


#15

What is the difference instead of using an IP-reservation with difficult name?


(Artem Fedai) #16

before patch we specify only IP - MAC based DHCP, patch gave you opportunity to specify appropriate name which would be resolved by all your NS clients


(Artem Fedai) #17

you can try with host which had ** instead of name


#18

That works also if you use the reservation option. I tested it without your patch.
My client can now resolve all names which I have used for reservation, even for these clients which send no hostname.

But many thanks for your time and suggestions.