Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setup DNSmasq DNS Server ?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Tue Feb 28, 2017 1:29 am    Post subject: Reply with quote

Once it's setup, it will work great. I had lots of trouble getting things right too, and one day it works, the next it doesn't sort of thing was driving me batty.

Well, I see that your dnsmasq machine is serving up the answers to both @acer and @gw2, and the response time is snappy.

What is in /etc/hosts on @gw1?

My dnsmasq machine, also at 192.168.0.1, is called "hypoid"

Code:
# /etc/hosts

127.0.0.1       localhost
192.168.0.1   hypoid.curvate.net      hypoid
192.168.0.1   curvate.net


I don't recall if just a SIGHUP to dnsmasq, or a restart is required to reload /etc/hosts.

That is the entire working part of my /etc/hosts on hypoid. All the other aliases are set by dnsmasq.
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Tue Feb 28, 2017 1:46 am    Post subject: Reply with quote

On my dnsmasq machine, in dnsmasq.conf (or its cousin)

Code:
resolv-file=/etc/resolv.dnsmasq


There is another resolv-file (dnsmasq can have multiples of this), but it is an artifact for ppp-dialup. I'm going to show the working contents of both, just for completeness

Code:
# /etc/resolv.dnsmasq

nameserver 208.67.220.220
nameserver 208.67.222.222
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 64.68.192.10


And for the dialup ...

Code:
# /etc/ppp/resolv.conf

nameserver 64.136.173.5
nameserver 64.136.164.77


That's the material that dnsmasq works from, but I want the LAN machines, all of them including the one running dnsmasq, to NOT seek answers from those nameservers, but instead to seek answers from 192.168.0.1.

So, all the network machines are setup with /etc/resolv.conf

Code:
# /etc/resolv.conf

domain curvate.net
nameserver 192.168.0.1


/etc/resolv.conf can be generated locally. In one case I have ...

Code:
# Generated by dhcpcd from wlan0.dhcp
domain curvate.net
nameserver 192.168.0.1
Back to top
View user's profile Send private message
cowboy0629
Tux's lil' helper
Tux's lil' helper


Joined: 11 May 2016
Posts: 76
Location: Kawartha Lakes, Ontario

PostPosted: Tue Feb 28, 2017 2:10 am    Post subject: Reply with quote

Something has happend I can get outside network but can't get anything internal.. just realized I can't read my websites anymore either... from internal network.. not sure what happend I had that working last night

now I am getting connection refused from outside network to websites


Last edited by cowboy0629 on Tue Feb 28, 2017 2:18 am; edited 1 time in total
Back to top
View user's profile Send private message
cowboy0629
Tux's lil' helper
Tux's lil' helper


Joined: 11 May 2016
Posts: 76
Location: Kawartha Lakes, Ontario

PostPosted: Tue Feb 28, 2017 2:12 am    Post subject: Reply with quote

cboldt --

would it be easier if I gave you access to network.. maybe you could see what is going on easier then I could explain it.. I also have screen installed so I could maybe see what I have done wrong..

Mike
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Tue Feb 28, 2017 2:21 am    Post subject: Reply with quote

Maybe a mix of DNS and firewall issues going on. We can troubleshoot the DNS independent of the firewall. Just stick to `dig` or `nslookup` (and maybe `route`) for now, and contents of the various /etc/hosts and /etc/resolv.conf files, plus setting up dnsmasq.

I don't think we need to arrange some stranger stepping on your turf just yet.
Back to top
View user's profile Send private message
cowboy0629
Tux's lil' helper
Tux's lil' helper


Joined: 11 May 2016
Posts: 76
Location: Kawartha Lakes, Ontario

PostPosted: Tue Feb 28, 2017 3:30 am    Post subject: Reply with quote

Ok.. Im now wondering what has happend from now and 4 hours ago everything was working perfect..

they only thing i changed was the acer file which i deleted and changed and still nothing.. things are getting worse...

should anything be in the host file of (ROUTER GW1) or it should be finding every thing from the other files just like it did the night before
Back to top
View user's profile Send private message
cowboy0629
Tux's lil' helper
Tux's lil' helper


Joined: 11 May 2016
Posts: 76
Location: Kawartha Lakes, Ontario

PostPosted: Tue Feb 28, 2017 6:32 am    Post subject: Reply with quote

Ok I seem to have Apache Working again on the LAN and WAN AGAIN..

Computers can't find each other but they can find gw1 now
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Tue Feb 28, 2017 11:26 am    Post subject: Reply with quote

I still want to see the contents of /etc/hosts on gw1

And, reading man dnsmasq, I see that you don't need to restart dnsmasq in order to read a changed /etc/hosts

Code:
When it receives a SIGHUP, dnsmasq clears its cache and then re-loads /etc/hosts ...


We should test DNS from gw1 and some other machine, vs. an outside IP addy. Try `dig curvate.net` and you should get 72.224.158.246, and that answer should come from 192.168.0.1

As for the mystery of changed behavior, the name/IP assignment dished out by DNS has a time to live (TTL), so some machines may know (or think they know) the name/IP assignment, even though DNS lookup isn't working. If they (think they) know, they don't ask.
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
Goto page Previous  1, 2
Page 2 of 2

 
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