LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-20-2020, 03:37 AM   #1
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Rep: Reputation: 30
dnsmasq not filtering


Hi
Env Debian 9.12
dnsmasq 2.76-5+deb9u2
in /etc/dnsmasq.conf i put the following line
address=/akamaized.net/127.0.0.1
but if issue
ping mediagol-meride-tv.akamiazed.net
it does not route to local host 127.0.0.1
it find an answering internet router...
what i'm missing ?
thanks in adavance
Maurizio
 
Old 04-20-2020, 04:19 AM   #2
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
further diagnose

going in /etc/init.d and restarting dnsmasq it issue a message stating resolv.conf not find ...according to debian wiki i set in dnsmasq the line
no-resolv
now dnsmasq starts without issuing any error messages ...
but it still does not work ..ping continue to reach destination servers
 
Old 04-20-2020, 05:16 AM   #3
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
resolv.conf

Hi
i write again into dnsmasq.conf
# no-resolv
then i go in /etc and i issue
ls -l resolv.conf
lrwxrwxrwx 1 root root 35 Apr 20 11:58 resolv.conf -> /var/run/NetworkManager/resolv.conf
opening the file i can read
# Generated by NetworkManager
nameserver 192.168.42.129
i write as first line
nameserver 127.0.0.1
save the file and restart dnsmasq service
issue
ping mediagol-meride-tv.akamaized.net
it correctly routes to localhost
but resolv.conf is generated automatically each time network manager starts
so i lost at every boot "nameserver 127.0.0.1"
how to proceeed ?
any help will be appreciated
Maurizio

Last edited by bong.mau; 04-20-2020 at 05:17 AM.
 
Old 04-20-2020, 05:50 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by bong.mau View Post
but resolv.conf is generated automatically each time network manager starts
so i lost at every boot "nameserver 127.0.0.1"
If your problem is the nameserver, do this:
Code:
nmcli con
to list all NetworkManager connections.

Then pick the connection that attaches the computer to the internet and
Code:
nmcli con mod CONNECTION ipv4.dns 127.0.0.1
nmcli con up CONNECTION
where CONNECTION is the correct connection.

Or use the dns directive in /etc/NetworkManager/NetworkManager.conf. See man NetworkManager.conf.
 
Old 04-20-2020, 07:07 AM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,799

Rep: Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775
DNSMasq reads the /etc/hosts file to pre-load tables. I suggest you put an entry "127.0.0.1 <name>" for the hosts you want to block by redirecting to localhost. That will preload that filtering into DNSMasq on startup.
 
Old 04-20-2020, 07:53 AM   #6
bong.mau
Member
 
Registered: Apr 2004
Posts: 391

Original Poster
Rep: Reputation: 30
hosts file..

Hi
I already use hosts file to filter data ....but in hosts file i have to specify the full address name ....in the dnsmasq.conf i can specify address=/akamaized.net/
and it blocks all domain addresses ...
this trackers are smart and use a lot of different address ...
there is a github hosts file well maintened ...but it is huge and network performances decrease ...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
content filtering with layer7- filtering rose1366m Linux - Networking 1 05-04-2011 11:10 AM
[DO NOT REPLY] dnsmasq not resolving. How to investigate? catkin Linux - Networking 1 02-12-2010 10:01 PM
dnsmasq problem, nat not working tank728 Slackware 9 05-26-2006 04:15 PM
dnsmasq: not resolving names of dhcp'd computers vimico Linux - Networking 3 03-19-2005 05:39 PM
Sendmail Spam filtering and Virus filtering MrJoshua Linux - General 2 04-03-2003 10:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration