经常我们在启动应用的时候发现系统需要的端口被别的程序占用,如何知道谁占有了我们需要的端口,很多人都比较头疼,下面就介绍一种非常简单的方法,希望对大家有用假如我们需要确定谁占用了我们的9050端口
1、Windows平台
在windows命令行窗口下执行:
C:\>netstat -aon|findstr "9050" TCP 127.0.0.1:9050
0.0.0.0:0 LISTENING 2016
看到了吗,端口被进程号为2016的进程占用,继续执行下面命令:
C:\>tasklist|findstr "2016"
tor.exe 2016 Console 0 16,064 K
很清楚吧,tor占用了你的端口
1、Windows平台
在windows命令行窗口下执行:
引用
C:\>netstat -aon|findstr "9050" TCP 127.0.0.1:9050
0.0.0.0:0 LISTENING 2016
看到了吗,端口被进程号为2016的进程占用,继续执行下面命令:
引用
C:\>tasklist|findstr "2016"
tor.exe 2016 Console 0 16,064 K
很清楚吧,tor占用了你的端口
一、安装
yum -y install bind
yum -y install bind-chroot
二、生成key
/usr/sbin/dnssec-keygen -a hmac-md5 -b 128 -n user rndc
cat Krndc.+157+13538.*
将生成串更新/etc/rndc.key中secret的值。
三、配制
#/var/named/chroot/etc/named.conf
// Default named.conf generated by install of bind-9.2.4-28.el4
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
Allow-transfer {tran;};
};
acl tran {192.168.0.174;};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone"hk.hn"{
type master;
file "hk.hn";
allow-transfer {192.168.100.174;};
};
include "/etc/rndc.key";
#cd /etc
#ln -s /var/named/chroot/etc/named.conf named.conf
yum -y install bind
yum -y install bind-chroot
二、生成key
/usr/sbin/dnssec-keygen -a hmac-md5 -b 128 -n user rndc
cat Krndc.+157+13538.*
将生成串更新/etc/rndc.key中secret的值。
三、配制
#/var/named/chroot/etc/named.conf
引用
// Default named.conf generated by install of bind-9.2.4-28.el4
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
Allow-transfer {tran;};
};
acl tran {192.168.0.174;};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone"hk.hn"{
type master;
file "hk.hn";
allow-transfer {192.168.100.174;};
};
include "/etc/rndc.key";
#cd /etc
#ln -s /var/named/chroot/etc/named.conf named.conf