View previous topic :: View next topic |
Author |
Message |
SteveYin Tux's lil' helper
Joined: 20 Oct 2004 Posts: 91
|
Posted: Thu May 29, 2014 6:21 am Post subject: dnsmasq can resolve fqdn of server but can not ping |
|
|
I have a lan with a gateway/dhcp/samba server, now I want to switch to use dnsmasq as a name/dhcp server, so I have these in my dnsmasq.conf
Code: |
domain-needed
bogus-priv
no-resolv
no-poll
server=61.155.5.6
server=122.200.77.34
local=/mylan.com/
interface=enp5s0
domain=mylan.com,192.168.0.0/24
dhcp-range=192.168.0.20,192.168.0.240,12h
cache-size=4096
no-negcache
log-dhcp
|
and this in my /etc/hosts
Code: |
127.0.0.1 localhost
::1 localhost
192.168.0.1 server.mylan.com
|
if I add some dummy server to dnsmasq like address=/dummy.mylan.com/192.168.0.x, then I can nslookup the dummy or dummy.mylan.com, and also can ping these two hosts.
but my server's name is server, and I can nslookup server.mylan.com or nslookup server, both will give me correct ip address of 192.168.0.1, but I can not ping the server.mylan.com, the ping command on windows give me this
Code: |
Ping request could not find host server.mylan.com. Please check the name and try again.
|
so what's wrong with my config? my server's ip address are static to 192.168.0.1, how can I both ping server and server.mylan.com? _________________ Steve Yin |
|
Back to top |
|
|
SteveYin Tux's lil' helper
Joined: 20 Oct 2004 Posts: 91
|
Posted: Thu May 29, 2014 6:27 am Post subject: |
|
|
got it!
the /etc/hosts file can only have the hostname part, so hosts file can only have
192.168.0.1 server
and can not use the fqdn name in hosts file
then add a address line to dnsmask.conf like
address=/server.mylan.com/192.168.0.1
then this will allow ping both server and server.mylan.com _________________ Steve Yin |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu May 29, 2014 12:37 pm Post subject: |
|
|
SteveYin wrote: | the /etc/hosts file can only have the hostname part, so hosts file can only have 192.168.0.1 server and can not use the fqdn name in hosts file |
SteveYin ... yes it can ...
best ... khay |
|
Back to top |
|
|
|
|
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
|
|