View previous topic :: View next topic |
Author |
Message |
elomaniak n00b
Joined: 27 Jan 2013 Posts: 47
|
Posted: Tue Sep 24, 2013 12:13 pm Post subject: Retrieve DNS Name from Host in LAN |
|
|
Hi folks, I am having a little problem.
i have a small PXE setup running here where the host has a ramdisk stored and the clients download this ramdisk during boot and boot this ramdisk into the ram and runs fine.
I would like to have the following situation.
the clients should get their dnsname from the server and display it instead of localhost
/etc/hosts
Code: | # IPv4 and IPv6 localhost aliases
127.0.0.1 localhost
::1 localhost
192.168.0.2 node1
192.168.0.3 node2
|
resolv.conf from client
Code: | nameserver 192.168.0.1 |
what do i have to do to achieve this?
dnsmasq.conf is enabled on eth3, which is the network card running with DHCPD and this is the network for the LAN, eth2 is connected to the internet.
if you need any more files, please let me know
thanks in avance |
|
Back to top |
|
|
olek Apprentice
Joined: 22 Oct 2011 Posts: 173
|
Posted: Tue Sep 24, 2013 2:37 pm Post subject: |
|
|
(1) Is your dnsmasq-service running?
(2) I presume 192.168.0.1 is the address of your dnsmasq-server?
(3) What is the resolv.conf of the dnsmasq-server?
(4) Is your dnsmasq-server reachable at port 53 (UDP)?
Here are my bits of /etc/dnsmasq.conf which might be of concern:
Code: |
#port= # so it listens on the fefault port 53
# Never forward plain names (without a dot or domain part)
domain-needed
# Never forward addresses in the non-routed address spaces.
bogus-priv
# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
local=/YOURLOCALNETSNAME/ |
_________________ https://plaintext.blog |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21633
|
Posted: Tue Sep 24, 2013 7:48 pm Post subject: |
|
|
Clients display their hostname. If no other hostname is set, they may call themselves localhost. Configure your DHCP client to respect the hostname set by the DHCP server. |
|
Back to top |
|
|
elomaniak n00b
Joined: 27 Jan 2013 Posts: 47
|
Posted: Tue Oct 01, 2013 6:38 am Post subject: |
|
|
Quote: | (1) Is your dnsmasq-service running? |
Yes it is running at boot
[quote](2) I presume 192.168.0.1 is the address of your dnsmasq-server?[quote]
Yes this is the servers IP
Quote: | (3) What is the resolv.conf of the dnsmasq-server? |
Code: | # Generated by dhcpcd from eth2
# /etc/resolv.conf.head can replace this line
domain *****.uni-frankfurt.de
nameserver ***.***.248.1
nameserver ***.***.246.1
# /etc/resolv.conf.tail can replace this line
|
eth3 is supposed to be the network for the pxe boot
Quote: | (4) Is your dnsmasq-server reachable at port 53 (UDP)? |
How can I check this?
Quote: | Here are my bits of /etc/dnsmasq.conf which might be of concern:
Code: |
#port= # so it listens on the fefault port 53
# Never forward plain names (without a dot or domain part)
domain-needed
# Never forward addresses in the non-routed address spaces.
bogus-priv
# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
local=/YOURLOCALNETSNAME/ |
|
|
|
Back to top |
|
|
dbishop Tux's lil' helper
Joined: 08 Dec 2007 Posts: 107
|
Posted: Tue Oct 01, 2013 3:14 pm Post subject: |
|
|
You might try dhcpdump on your host to make sure everything is in the dhcp exchange that you think should be there. (net-analyzer/dhcpdump-1.8, as of today, but you'll need to keyword it though)
Code: |
dhcpdump <-i interface> [-h macaddress]
|
Technically you can do this with tcpdump or wireshark, but I have found that for DHCP issues, dhcpdump is perfect.
To see if your DNS server is reachable, you can use something like nslookup and specify the server IP. Here's how I do it on my network (although I use bind, not dnsmasq)
Code: | bbking ~ # nslookup google.com 172.16.3.1
Server: 172.16.3.1
Address: 172.16.3.1#53
Non-authoritative answer:
Name: google.com
Address: 74.125.228.105 |
Alternatively you can use tcpdump on your host like this:
Code: | tcpdump -i eth3 port 53 and host 192.168.0.1 |
You can use the IP of host machine or the one that is pxe-booting. Hopefully these suggestions will help you see what is going on. |
|
Back to top |
|
|
olek Apprentice
Joined: 22 Oct 2011 Posts: 173
|
Posted: Tue Oct 01, 2013 8:26 pm Post subject: |
|
|
Are the clients getting the names inside your servers /etc/hosts over dns? _________________ https://plaintext.blog |
|
Back to top |
|
|
|