LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-13-2024, 08:06 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 561

Rep: Reputation: 10
Post After installing Dnsmasq, the domain name is not pinged


Hello,
I used the article https://www.howtoforge.com/how-to-se...-on-debian-12/ to configure an internal DNS server. My server has two network cards as follows:
Code:
# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fe7b:8f51  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:7b:8f:51  txqueuelen 1000  (Ethernet)
        RX packets 39840  bytes 44840112 (42.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 23678  bytes 2087208 (1.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.20  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a00:27ff:febe:5df0  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:be:5d:f0  txqueuelen 1000  (Ethernet)
        RX packets 495  bytes 42060 (41.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 250  bytes 18000 (17.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 91  bytes 6693 (6.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 91  bytes 6693 (6.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
After installing Dnsmasq, I can only ping the IP address:
Code:
# ping google.com
^C
# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=63 time=36.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=63 time=36.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=63 time=29.4 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 29.374/34.311/36.857/3.491 ms
In my Dnsmasq configuration I used the enp0s8 network card. The IP forwarding is also active:
Code:
# sysctl -p
net.ipv4.ip_forward = 1
I also used the following iptables rule:
Code:
# iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
# iptables-save
What is wrong?

Thank you.
 
Old 04-13-2024, 10:56 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,142

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
Please post the output of iptables-save and the contents of /etc/resolve.conf
 
Old 04-13-2024, 11:31 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,713

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Quote:
I can only ping the IP address
Are you asking about internal or external IP addresses?

As you asking about this PC or other clients?

Not enough information and without seeing the dnsmasq.conf file impossible to say what is wrong.
 
1 members found this post helpful.
Old 04-15-2024, 08:37 PM   #4
Ladowny
Member
 
Registered: Oct 2006
Distribution: Debian, OpenBSD, FreeBSD
Posts: 53

Rep: Reputation: 14
If you can ping google DNS cache server then IP forwarding is working. Are you allowing outgoing traffic to port 53?
Try this command to send DNS query to google DNS server directly bypassing whatever resolvers you have configured
Code:
dig @8.8.8.8 google.com
or you you have 'host' utility installed
Code:
host google.com 8.8.8.8
If you are not getting response you are probably blocking outgoing traffic to port 53 on your machine. What is your policy for the chain OUTPUT ?

Code:
iptables -L OUTPUT
If it's not ACCEPT, try running this command to allow all outgoing traffic
Code:
iptables -P OUTPUT ACCEPT
Is this machine your internet gateway? Does not look like it as both IP addresses are private. What's the output of this command?
Code:
route -n
If you specified these options as per the howto you mention
Code:
no-resolv
lare and google public DNS
server=1.1.1.1
server=8.8.8.8
You've told DNSMasq not to use servers defined in your /etc/resolv.conf but specific DNS servers above. What servers have you got in resolv.conf file, your machine is still using these. What is in there?
 
  


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
DNSMasq - dnslookup build.domain.local works but ping build.domain.local doesnt mustaghattack Linux - Server 2 03-01-2010 09:00 PM
iptables DROP icmp applied, still being pinged linuxistan Linux - Networking 3 10-18-2004 10:26 PM
linux network problem! HELP! cannot be pinged by other computers! debug019 Linux - Newbie 1 10-17-2004 11:15 PM
Mandrake 9.2 box can't be pinged by network but is connected JohnLocke Linux - Networking 2 06-28-2004 05:32 PM
pinged, or scanned with nmap ivanatora Linux - Software 1 09-22-2003 02:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:54 AM.

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