Does anyone know of a way to get ncat to listen on port 53 when using systemd-resolved?
[root@meimei ~]# ncat -l -4 -p 53 Ncat: bind to 0.0.0.0:53: Address already in use. QUITTING.
(no rants, please)
Hi Ed,
Ed Greshko wrote:
Does anyone know of a way to get ncat to listen on port 53 when using systemd-resolved?
[root@meimei ~]# ncat -l -4 -p 53 Ncat: bind to 0.0.0.0:53: Address already in use. QUITTING.
You can't bind to the port if it's already in use. But if you're okay with using a local IP, you can bind to 127.0.0.2 (or anything > .1, if resolved or other dns server are listening on localhost).
$ sudo ncat -l -4 127.0.0.2 53
I didn't use the -p option there, as it's for the source port. Using the -p option doesn't do what I presume you want, which is to have ncat listening on port 53 so you can connect to it for testing.
(no rants, please)
Where's the fun in that? ;)
On 21/04/2021 08:29, Todd Zullinger wrote:
Hi Ed,
Ed Greshko wrote:
Does anyone know of a way to get ncat to listen on port 53 when using systemd-resolved?
[root@meimei ~]# ncat -l -4 -p 53 Ncat: bind to 0.0.0.0:53: Address already in use. QUITTING.
You can't bind to the port if it's already in use. But if you're okay with using a local IP, you can bind to 127.0.0.2 (or anything > .1, if resolved or other dns server are listening on localhost).
$ sudo ncat -l -4 127.0.0.2 53I didn't use the -p option there, as it's for the source port. Using the -p option doesn't do what I presume you want, which is to have ncat listening on port 53 so you can connect to it for testing.
OK, I confused myself by using IP:port.
But still....
[root@f33g ~]# ncat -l -4 192.168.122.26 53 Ncat: bind to 192.168.122.26:53: Cannot assign requested address. QUITTING.
(no rants, please)
Where's the fun in that? ;)
That kind of "fun" I can do without.
Ed Greshko wrote:
On 21/04/2021 08:29, Todd Zullinger wrote:
Hi Ed,
Ed Greshko wrote:
Does anyone know of a way to get ncat to listen on port 53 when using systemd-resolved?
[root@meimei ~]# ncat -l -4 -p 53 Ncat: bind to 0.0.0.0:53: Address already in use. QUITTING.
You can't bind to the port if it's already in use. But if you're okay with using a local IP, you can bind to 127.0.0.2 (or anything > .1, if resolved or other dns server are listening on localhost).
$ sudo ncat -l -4 127.0.0.2 53I didn't use the -p option there, as it's for the source port. Using the -p option doesn't do what I presume you want, which is to have ncat listening on port 53 so you can connect to it for testing.
OK, I confused myself by using IP:port.
But still....
[root@f33g ~]# ncat -l -4 192.168.122.26 53 Ncat: bind to 192.168.122.26:53: Cannot assign requested address. QUITTING.
Do you have a 192.168.122.26 interface on the host? That's the error I see if I try to use an IP which is not assigned to any interface.
If that's the issue, you could create an alias for an existing interface with that IP and use it for testing.
On 21/04/2021 09:25, Todd Zullinger wrote:
Do you have a 192.168.122.26 interface on the host? That's the error I see if I try to use an IP which is not assigned to any interface.
Sure. But it didn't help that I forgot I had created a process a few weeks ago that happened to grab that port on that VM. I could have swore it was a different VM.
Excuse me while I wipe the egg from my face.
Thanks.....