{"id":3154,"date":"2015-02-19T15:27:33","date_gmt":"2015-02-19T12:27:33","guid":{"rendered":"http:\/\/webware.biz\/?p=3154"},"modified":"2018-12-03T02:47:46","modified_gmt":"2018-12-02T23:47:46","slug":"kak-uznat-geograficheskoe-raspolozhenie-po-ip-adresu-iz-komandnoj-stroki","status":"publish","type":"post","link":"https:\/\/codeby.net\/blogs\/kak-uznat-geograficheskoe-raspolozhenie-po-ip-adresu-iz-komandnoj-stroki\/","title":{"rendered":"\u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e IP \u0430\u0434\u0440\u0435\u0441\u0443 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438"},"content":{"rendered":"<p style=\"text-align: justify;\">\n\t\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u0433\u0434\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u0437\u0435\u043c\u043b\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0451\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 (\u0438\u043b\u0438 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442), \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u043b\u0430\u0439\u043d \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 GeoIP (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, geoiptool.com). \u042d\u0442\u0438 \u043e\u043d\u043b\u0430\u0439\u043d \u0441\u043b\u0443\u0436\u0431\u044b, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 GeoIP, \u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a <a href=\"https:\/\/dev.maxmind.com\/geoip\/legacy\/geolite\/\">MaxMind<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0431 \u0441\u043b\u0443\u0436\u0431, \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a GeoIP \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 Linux.\n<\/p>\n<p style=\"text-align: justify;\">\n\t\u0412 \u044d\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c, <strong>\u043a\u0430\u043a \u043d\u0430\u0439\u0442\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435&nbsp;IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432&nbsp;<span style=\"line-height: 20.7999992370605px; text-align: justify;\">Linux.<\/span><\/strong>\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t\u041f\u0435\u0440\u0432\u044b\u0439<!--more--> \u043c\u0435\u0442\u043e\u0434<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\t\u041f\u0435\u0440\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 &mdash; \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 <strong>geoiplookup<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f GeoIP \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 MaxMind. geoiplookup \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438\u043b\u0438 \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e IP \u0430\u0434\u0440\u0435\u0441\u0443 (\u0438\u043b\u0438 \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430). \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 (\u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 GeoIP, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0439 \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442) \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.\n<\/p>\n<p style=\"text-align: justify;\">\n\t\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 geoiplookup \u0432 Debian, Ubuntu \u0438\u043b\u0438 Linux Mint:\n<\/p>\n<pre class=\"brush:bash;\">\n$ sudo apt-get install geoip-bin\n<\/pre>\n<p style=\"text-align: justify;\">\n\t\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 geoiplookup \u0432 Fedora:\n<\/p>\n<pre class=\"brush:bash;\">\n$ sudo yum install geoip\n<\/pre>\n<p style=\"text-align: justify;\">\n\t\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 geoiplookup \u0432 CentOS, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 EPEL, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 yum \u043a\u043e\u043c\u0430\u043d\u0434\u0443:\n<\/p>\n<pre class=\"brush:bash;\">\n$ sudo yum install geoip\n<\/pre>\n<p style=\"text-align: justify;\">\n\t\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 geoiplookup \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 GeoIP.dat, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0449\u0451\u043d \u0432 \/usr\/share\/GeoIP. \u0421 \u044d\u0442\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0441\u0442\u0440\u0430\u043d\u0435.\n<\/p>\n<pre class=\"brush:bash;\">\n$ geoiplookup 27.145.177.75\n<\/pre>\n<pre class=\"brush:plain;\">\nGeoIP Country Edition: TH, Thailand\n<\/pre>\n<p style=\"text-align: justify;\">\n\t\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 GeoIP \u0441 <a href=\"https:\/\/dev.maxmind.com\/geoip\/legacy\/geolite\/\">MaxMind<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u0434\u0443\u0442 \u0432\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 IP \u0430\u0434\u0440\u0435\u0441\u0430\u0445, \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u0442\u0440\u0430\u043d\u0435. \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0438\u0439 \u0444\u0430\u0439\u043b GeoIP.dat \u0441 \u044d\u0442\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430. \u042d\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f, \u0442.&nbsp;\u043a. GeoIP.dat \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c \u043a \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0430\u043c\u0438 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 Linux. \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 GeoIP, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u043d\u0430 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0435 MaxMind, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0441\u044f\u0446.\n<\/p>\n<p style=\"text-align: justify;\">\n\t\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 GeoIP \u0441 MaxMind, \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043b\u044f cron, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.\n<\/p>\n<pre class=\"brush:bash;\">\n$ wget http:\/\/geolite.maxmind.com\/download\/geoip\/database\/GeoLiteCountry\/GeoIP.dat.gz\n$ wget http:\/\/geolite.maxmind.com\/download\/geoip\/database\/GeoLiteCity.dat.gz\n$ wget http:\/\/download.maxmind.com\/download\/geoip\/database\/asnum\/GeoIPASNum.dat.gz\n$ gunzip GeoIP.dat.gz\n$ gunzip GeoIPASNum.dat.gz\n$ gunzip GeoLiteCity.dat.gz\n$ sudo cp GeoIP.dat GeoIPASNum.dat GeoLiteCity.dat \/usr\/share\/GeoIP\/<\/pre>\n<p style=\"text-align: justify;\">\n\t\u0421\u0435\u0439\u0447\u0430\u0441, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 geoiplookup, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 AS \u043d\u043e\u043c\u0435\u0440\u0435 IP \u0430\u0434\u0440\u0435\u0441\u0430. \u042d\u0442\u043e, \u0432 \u043e\u0431\u0449\u0438\u0445 \u0447\u0435\u0440\u0442\u0430\u0445, \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0432\u0430\u043c&nbsp;\u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0434\u043e\u043c\u0435\u043d\u0443,&nbsp;<span style=\"line-height: 20.7999992370605px; text-align: justify;\">IP.<\/span>\n<\/p>\n<pre class=\"brush:bash;\">\n$ geoiplookup 27.145.177.75<\/pre>\n<pre class=\"brush:bash;\">\nGeoIP Country Edition: TH, Thailand\nGeoIP ASNum Edition: AS17552 True Internet Co.,Ltd.<\/pre>\n<p style=\"text-align: justify;\">\n\t\u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0431\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 geoiplookup \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e GeoIP.dat \u0438 GeoIPASNum.dat, \u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 GeoLiteCity.dat. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0432\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0433\u043e\u0440\u043e\u0434\u0435.\n<\/p>\n<p style=\"text-align: justify;\">\n\t\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0433\u043e\u0440\u043e\u0434\u0435, \u044f\u0432\u043d\u043e \u0441\u043a\u0430\u0436\u0438\u0442\u0435 geoiplookup \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 GeoLiteCity.dat.\n<\/p>\n<pre class=\"brush:bash;\">\n$ geoiplookup -f \/usr\/share\/GeoIP\/GeoLiteCity.dat 27.145.177.75<\/pre>\n<pre class=\"brush:plain;\">\nGeoIP City Edition, Rev 1: TH, N\/A, N\/A, N\/A, N\/A, 13.750000, 100.466698, 0, 0\n<\/pre>\n<p style=\"text-align: justify;\">\n\t\u0412\u044b\u0432\u043e\u0434, \u043e\u0431\u044b\u0447\u043d\u043e, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u043e, \u0433\u043e\u0440\u043e\u0434, \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434, \u0432\u044b\u0441\u043e\u0442\u0443 \u0438 \u0434\u043e\u043b\u0433\u043e\u0442\u0443. \u0412 \u043c\u043e\u0451\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c\u0438. \u0423 \u0432\u0430\u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043b\u0443\u0447\u0448\u0435. \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0430\u0445 \u0438 \u0441\u0435\u0442\u044f\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b \u0434\u043b\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u043f\u043e\u043b\u043e\u0441\u043d\u044b\u0445 IP \u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u043d\u043e \u043c\u0435\u043d\u0435\u0435 \u0442\u043e\u0447\u043d\u044b \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t\u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\t\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0445\u043b\u043e\u043f\u043e\u0442 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 <span style=\"line-height: 20.7999992370605px; text-align: justify;\">GeoIP<\/span>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u043d\u043b\u0430\u0439\u043d \u0441\u0435\u0440\u0432\u0438\u0441 ipinfo.io. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, ipinfo.io \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 API, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 JSON, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441 \u043b\u0451\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u044e&nbsp;\u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432\u0440\u043e\u0434\u0435 curl.\n<\/p>\n<pre class=\"brush:bash;\">\n$ curl ipinfo.io\/27.145.177.75\n<\/pre>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/codeby.net\/blogs\/wp-content\/uploads\/2015\/02\/0212.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"02\" class=\"alignnone size-full wp-image-3155\" height=\"406\" src=\"https:\/\/codeby.net\/blogs\/wp-content\/uploads\/2015\/02\/0212.jpg\" width=\"743\" srcset=\"https:\/\/codeby.net\/blogs\/wp-content\/uploads\/2015\/02\/0212.jpg 743w, https:\/\/codeby.net\/blogs\/wp-content\/uploads\/2015\/02\/0212-300x164.jpg 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u0445 API \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d 1,000 API \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0432 \u0434\u0435\u043d\u044c.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t\u0414\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\t\u0427\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 (\u043d\u0430 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0435), \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u043b\u0438 \u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 whois. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043d\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a (\u0432\u043c\u0435\u0441\u0442\u043e IP \u0430\u0434\u0440\u0435\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430).\n<\/p>\n<pre class=\"brush:bash;\">\nwhois 27.145.177.75\n<\/pre>\n<p style=\"text-align: justify;\">\n\t\u0415\u0441\u043b\u0438 \u0435\u0449\u0451 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435\n<\/p>\n<pre class=\"brush:bash;\">\nsudo apt-get install whois\n<\/pre>\n<p style=\"text-align: justify;\">\n\t\u0418 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0438\u0437 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:\n<\/p>\n<pre class=\"brush:bash;\">\n#!\/bin\/bash\nIP=`\/usr\/bin\/zenity --entry \n--width=300 \n--title=&quot;\u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e IP&quot; \n--text=&quot;\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 IP:&quot;`\nif [ $? -eq 1 ];\nthen\nexit -1\nfi\ncurl ipinfo.io\/${IP} | zenity --text-info --width 530 --height 350<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u0433\u0434\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u0437\u0435\u043c\u043b\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0451\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 (\u0438\u043b\u0438 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442), \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u043b\u0430\u0439\u043d \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 GeoIP (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, geoiptool.com). \u042d\u0442\u0438 \u043e\u043d\u043b\u0430\u0439\u043d \u0441\u043b\u0443\u0436\u0431\u044b, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 GeoIP, \u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a MaxMind. \u041a\u0440\u043e\u043c\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0431 \u0441\u043b\u0443\u0436\u0431, \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a GeoIP \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 &#8230; <a title=\"\u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e IP \u0430\u0434\u0440\u0435\u0441\u0443 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\" class=\"read-more\" href=\"https:\/\/codeby.net\/blogs\/kak-uznat-geograficheskoe-raspolozhenie-po-ip-adresu-iz-komandnoj-stroki\/\" aria-label=\"\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e IP \u0430\u0434\u0440\u0435\u0441\u0443 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435<\/a><\/p>\n","protected":false},"author":66057,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1506],"tags":[91,139,182,206],"class_list":["post-3154","post","type-post","status-publish","format-standard","hentry","category-nastrojka-linuks","tag-curl","tag-geoiplookup","tag-ip","tag-linux"],"_links":{"self":[{"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/posts\/3154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/users\/66057"}],"replies":[{"embeddable":true,"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/comments?post=3154"}],"version-history":[{"count":0,"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/posts\/3154\/revisions"}],"wp:attachment":[{"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/media?parent=3154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/categories?post=3154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeby.net\/blogs\/wp-json\/wp\/v2\/tags?post=3154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}