LinuxQuestions.org
Review your favorite Linux distribution.
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 10-07-2022, 10:27 PM   #1
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
Port 53 is closed; how to fix?


Hello and thanks for reading/answering.

I have no internet connection, or not much of it. I can ping 8.8.8.8 but I cannot update or connect with my browser. This is a multiboot laptop and a couple of other systems are able to connect without problems, so it is this Debian system that has a problem.
Code:
aris@hp2Debian:~$ uname -a
Linux hp2Debian 5.19.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.11-1 (2022-09-24) x86_64 GNU/Linux
Some search indicated that port 53 could be closed and I have verified that. More search did not provide an answer on how to open it. The only answers have to do with /etc/resolv.conf but
Code:
aris@hp2Debian:~$ cat /etc/resolv.conf
# Generated by NetworkManager
I do not have a clue on how to proceed from here to fix this. Any help is welcome.
 
Old 10-08-2022, 12:20 AM   #2
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
IF your resolv.conf is 'empty' as you posted,
That is the problem (I think). It seems to happen a lot, but I don't know the whole story. (Hopefully an expert will chime in.) Here's a (LQ) link that might help:
https://www.linuxquestions.org/quest...on-4175699145/

P. S. I don't think port 53 needs to be 'open' (do you mean listening? You're not a [dns] server(?)!) But I've seen some strange stuff I don't understand about 127.0.0.53[:53] (systemd-resolved)
https://www.tecmint.com/resolve-temp...me-resolution/

Last edited by !!!; 10-08-2022 at 01:27 AM.
 
Old 10-08-2022, 12:26 AM   #3
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
From the output I guess resolv.conf is taken care by the NetworkManager. Checking the man page of the NetworkManager did not provide results of how to fix this.

Just now I was looking at a page and the port can be opened with ufw, but I am not sure if it is going to be fixed. I will try the following command after installing the ufw package with dpkg (at least all the dependencies are installed)
Code:
ufw allow 53/tcp
 
Old 10-08-2022, 12:29 AM   #4
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Arrow Are you running a DNS named SERVER? I don't think so!!!

Sorry, I just edited in something about Port 53 while you were posting.

Maybe try adding (manually editing) in a nameserver (8.8.8.8 into resolv.conf)

This is probably beyond my level of knowledge, so hopefully someone else will chime in

Last edited by !!!; 10-08-2022 at 01:57 AM.
 
Old 10-08-2022, 12:38 AM   #5
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
Great, now I lost port 22. I will have to get back to this later.

Edit. I got back port 22. But port 53 stays closed, does not open.
Code:
aris@hp2Debian:~$ sudo ufw status
Status: active
To                         Action      From
--                         ------      ----
53/tcp                     ALLOW       Anywhere                  
22/tcp                     ALLOW       Anywhere                  
53/tcp (v6)                ALLOW       Anywhere (v6)             
22/tcp (v6)                ALLOW       Anywhere (v6)

aris@hb8DebianS:~$ nmap -Pn 192.168.0.12
Nmap scan report for 192.168.0.12
PORT   STATE  SERVICE
22/tcp open   ssh
53/tcp closed domain
I will get back later.

Last edited by Debian6to11; 10-08-2022 at 12:44 AM.
 
Old 10-08-2022, 01:47 AM   #6
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Question Please excuse my trying to learn here!!!

Does 'closed' just mean that: no domain name server is running? (normal/expected/reasonable)

And it was just the (unnecessary) 'ufw allow 53/tcp' that made it appear (tho 'closed') in the nmap output?

And is 127.0.0.53:53 some (relatively new) systemd-resolved 'magic' ('evil' to systemd 'haters')?
And localhost is exempt from ufw blocking:
https://serverfault.com/questions/10...ful-connection

I'm guessing that: 22 sshd server disappeared when ufw was enabled, and appeared when it was 'allow'ed... Yes?

I'm just trying to learn how stuff works, so please don't get mad at me!!!

Last edited by !!!; 10-08-2022 at 01:59 AM.
 
Old 10-08-2022, 03:24 AM   #7
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
Quote:
Originally Posted by !!! View Post
I'm guessing that: 22 sshd server disappeared when ufw was enabled, and appeared when it was 'allow'ed... Yes?
I can only answer this one. Yes, all the output below was added by myself (ufw allow <port>/tcp), but apart from port 22, all the others are closed. I also do not know how his works and whether I have done the right thing adding ufw. Let's see if someone that knows what's going on might reply. nmap is not installed on the problem system so I use another computer for the output.

Code:
aris@hb8DebianS:~$ nmap -Pn 192.168.0.12
PORT    STATE  SERVICE
22/tcp  open   ssh
53/tcp  closed domain
80/tcp  closed http
443/tcp closed https
I will include the output of nslookup, maybe it helps someone.
Code:
aris@hp2Debian:~$ nslookup 127.0.0.53
;; communications error to ::1#53: connection refused
;; communications error to ::1#53: connection refused
;; communications error to ::1#53: connection refused
;; communications error to 127.0.0.1#53: connection refused
;; no servers could be reached
It seems I have the same problem on another system (Kali) on the same laptop. Only port 22 is open.
The other six systems on the laptop are okay.
 
Old 10-08-2022, 03:32 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@OP
You don't need to open port 53 on your box, unless you're running your own nameserver authoritative for some domain(s).

Just add a couple of nameservers in resolv.conf in order to resolve hostnames.

Regards
 
Old 10-08-2022, 07:21 AM   #9
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
Solved, false alarm

Port 53: DNS uses Port 53 which is nearly always open on systems, firewalls, and clients to transmit DNS queries.
So it is a necessity on a system.

But back to my problem. It had nothing to do with the port. Here is the story.

About 15-20 days ago we changed ISP. The change also reflected the DNS servers that I had in the network configurations of every computer. I removed the old entries and left the settings to automatic. Everything was working. One of my computers, about a week ago, refused to connect, same story as described in the OP. The next time I booted it was okay so I did not cared much about it. Then yesterday I had my OP problem. Last night I had a long night going through the settings of the modem and my access point and after I posted the OP, I saw in the modem settings they had DNS IP addresses. I thought to give it a try and they just got connected. All I needed to do was to place the new DNS server addresses in the network configurations. And this is how the problem was solved.

Thanks for the help
 
Old 10-08-2022, 08:06 AM   #10
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,602

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546
Quote:
Originally Posted by Debian6to11 View Post
Port 53: DNS uses Port 53 which is nearly always open on systems, firewalls, and clients to transmit DNS queries.
So it is a necessity on a system.
There is a difference between an open/closed port (incoming) and a firewall configured to blocks outgoing connections (which is not the default behaviour).

As others have said, port 53 needs to be open for servers listening for DNS queries, same as port 80 needs to be open for servers listening for HTTP requests.

You don't need to open the ports for regular machines not running those servers; this does not stop clients from working, because an "open port" refers to incoming traffic.

If you had configured the firewall to block outgoing traffic on port 53 you would (hopefully) know that you'd done that, but more importantly it would be listed in the "ufw status" output. (Unless it was blocked elsewhere in the network, but that would then affect more than just the single OS.)

 
Old 10-08-2022, 09:29 AM   #11
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
Okay, I do not know much about ports, but I thought they were like a two way switch, open or closed.

When a port is in a listening mode it must be in an open state, right? Or am I completely at fault and there is another stage?
 
Old 10-09-2022, 01:55 AM   #12
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
@#10&all: I/we need a bit more help understanding 'closed' (my first two questions in #6). I'm guessing open = (daemon)listening (any difference? Did the presence of a firewall cause the different state-word: open versus listening?)
And closed versus not being listed at all (as is every other port) is the result of the firewall running?
Yeah I'm quite confused here!!!
(I tried Googling but couldn't find anything solid and understandable)
Edit update: I found something from this Google:
-spanning what are all the possible different network intitle:Port intitle:States?
https://geek-university.com/port-states/
More detailed info on the 6 nmap Port States:
https://wiki.onap.org/plugins/servle.../view/35520753


For simplicity, I 'slightly recommend' OP:
apt remove ufw, since they solved the problem by: "placing the new DNS server addresses in the ?network configurations?" (exactly what 'net configs' files&content did you change=update?)

Last edited by !!!; 10-09-2022 at 02:13 AM.
 
Old 10-09-2022, 06:05 AM   #13
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382

Original Poster
Blog Entries: 1

Rep: Reputation: 71
Thanks for the advice for removing ufw. I purged the package and also had a line saying "Purging configuration files for ufw". The system is working as it should. And that was a good link about nmap port states.

Funny side note is that nmap does not show anything about port 53 now. So is that port used only if you have a DNS service installed?
 
  


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
Cannot fix broken package using "sudo apt --fix-broken install" to fix XFCE packages for Zorin OS 16 Core AltFantasy Zorin OS 8 09-25-2021 06:51 AM
Closed Port/Port in use when attempting to port forward for server. Tetrad Linux - Networking 2 07-06-2015 11:54 AM
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 04:36 PM
Port Scan: Closed Port instead of Stealth unihiekka Linux - Security 9 12-26-2005 08:51 PM
firewall.rc.config says :"open port 8080" but nmap says port is closed saavik Linux - Security 2 02-14-2002 12:16 PM

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

All times are GMT -5. The time now is 12:27 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