Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Retrieve DNS Name from Host in LAN
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
elomaniak
n00b
n00b


Joined: 27 Jan 2013
Posts: 47

PostPosted: Tue Sep 24, 2013 12:13 pm    Post subject: Retrieve DNS Name from Host in LAN Reply with quote

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
View user's profile Send private message
olek
Apprentice
Apprentice


Joined: 22 Oct 2011
Posts: 173

PostPosted: Tue Sep 24, 2013 2:37 pm    Post subject: Reply with quote

(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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Tue Sep 24, 2013 7:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
elomaniak
n00b
n00b


Joined: 27 Jan 2013
Posts: 47

PostPosted: Tue Oct 01, 2013 6:38 am    Post subject: Reply with quote

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
View user's profile Send private message
dbishop
Tux's lil' helper
Tux's lil' helper


Joined: 08 Dec 2007
Posts: 107

PostPosted: Tue Oct 01, 2013 3:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
olek
Apprentice
Apprentice


Joined: 22 Oct 2011
Posts: 173

PostPosted: Tue Oct 01, 2013 8:26 pm    Post subject: Reply with quote

Are the clients getting the names inside your servers /etc/hosts over dns?
_________________
https://plaintext.blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum