dig

DNS服务器搭建

牧云@^-^@ 提交于 2019-12-04 16:12:52
一、DNS简介: DNS是域名系统(Domain Name System)的缩写,是因特网上的一项核心服务,能够将域名解析为IP地址,也能把IP地址解析为域名,正向解析即把域名解析为IP,反向解析即把IP解析为域名。 二、DNS查询方法: 1.2 DNS查询方法:递归查询和迭代查询。递归查询指客户端向服务器端发送查询请求,服务器将在本服务器上查询并告诉客户端结果,若本服务器不能解析,则服务器会转发给其他指定的DNS服务器查询,并转发回来由自己传送给客户端。迭代查询指服务器自己不能解析时转发给别的服务器并由别的服务器直接传送给客户端。转发器和根提示就是依据这两种方法而实现的。 三、域名解析过程 1、如果本地的dns解析器有缓存直接返回; 2、查找本地hosts文件,根据对应的映射返回IP; 3、指定DNS服务器,DNS服务器有缓存直接返回; 4、解析域名,将请求交给根域DNS(如果没开启转发,全球13个根域DNS); 5、根域告诉DNS服务器.com的DNS地址; 6、DNS服务器查找.com解析www.baidu.com; 7、.com域DNS告诉DNS服务器baidu.com的DNS; 8、DNS服务器查找baidu.com DNS; 9、baidu.com 返回www.baidu.com的IP地址给DNS服务器; 10、DNS服务器将DNS响应报文返回给用户。 四

dig-基本使用

≯℡__Kan透↙ 提交于 2019-12-03 10:11:27
dig:Domain Information Groper,是一个DNS查询工具 1:使用google的域名服务器:查询特定域名的A记录 [root@localhost ~]# dig @8.8.8.8 www.baidu.com A ###格式:dig @dnsserver name querytype ###如果没有设置@dnsserver,则会依次使用/etc/resolv.conf来解析 ; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> @8.8.8.8 www.baidu.com A ###dig这个程序的版本号和要查询的域名 ; (1 server found) ### 1个结果 ;; global options: +cmd ###表示可以在命令后面加的命令 ;; Got answer: ###获取到的结果 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20306 ### 返回信息的头部 ###opcode: 操作码,QUERY,代表是查询操作; ###status: 状态,NOERROR,代表没有错误; ###id: 编号:20306 ,16 bit数字,在dns协议中,通过编号匹配返回和查询. ;; flags: qr rd ra; QUERY: 1,

Pass stdin into Unix host or dig command

两盒软妹~` 提交于 2019-12-03 08:12:13
Let's say I have a list of IPs coming into a log that I'm tailing: 1.1.1.1 1.1.1.2 1.1.1.3 I'd like to easily resolve them to host names. I'd like to be able to tail -f access.log | host - Which fails as host doesn't understand input from stdin in this way. What's the easiest way to do with without having to write a static file or fallback to perl/python/etc.? Sinan Taifour Use xargs -l : tail -f access.log | xargs -l host You could also use the read builtin: tail -f access.log | while read line; do host $line; done Acumenus In the commands below, replace cat with tail -f , etc. if needed.

Is there any better way to find the digit multiplication and summation?

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: int N = 2345 ; var digitArray = N . ToString (). ToCharArray (); int multiplicationSum = 1 ; foreach ( char digit in digitArray ) { multiplicationSum = int . Parse ( digit . ToString ()) * multiplicationSum ; } var sum = 0 ; var sumArray = multiplicationSum . ToString (). ToCharArray (); foreach ( char digit in sumArray ) { sum = int . Parse ( digit . ToString ()) + sum ; } Thanks 回答1: Assuming you don't need to deal with negative numbers, it seems doing it mathematically would make a lot more sense int N = 2345 ; int

Ruby Style: How to check whether a nested hash element exists

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Consider a "person" stored in a hash. Two examples are: fred = {:person => {:name => "Fred", :spouse => "Wilma", :children => {:child => {:name => "Pebbles"}}}} slate = {:person => {:name => "Mr. Slate", :spouse => "Mrs. Slate"}} If the "person" doesn't have any children, the "children" element is not present. So, for Mr. Slate, we can check whether he has parents: slate_has_children = !slate[:person][:children].nil? So, what if we don't know that "slate" is a "person" hash? Consider: dino = {:pet => {:name => "Dino"}} We can't easily check

Ruby Style: How to check whether a nested hash element exists

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Consider a "person" stored in a hash. Two examples are: fred = {:person => {:name => "Fred", :spouse => "Wilma", :children => {:child => {:name => "Pebbles"}}}} slate = {:person => {:name => "Mr. Slate", :spouse => "Mrs. Slate"}} If the "person" doesn't have any children, the "children" element is not present. So, for Mr. Slate, we can check whether he has parents: slate_has_children = !slate[:person][:children].nil? So, what if we don't know that "slate" is a "person" hash? Consider: dino = {:pet => {:name => "Dino"}} We can't easily check

Google App Engine - list of IP addresses?

匿名 (未验证) 提交于 2019-12-03 00:48:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I know that Google App Engine does not support an application having a static IP address, but I'd like to know if there is a list or range of IP addresses that an app could potentially have? I'd like to use that list as a whitelist of IP addresses for another application deployed elsewhere. 回答1: In addition to the other answers, GAE premier support directed me to this name, esp as the source IP address for URLFetch calls: $ dig - t txt _cloud - netblocks . googleusercontent . com which answers: include : _cloud - netblocks1 .

树莓派DHT11温湿度传感器+BMP280大气气压传感器

匿名 (未验证) 提交于 2019-12-03 00:43:02
bmp: #ifndef _RASPI_BMP280_H_ #define _RASPI_BMP280_H_ #include <stdio.h> #include <wiringPi.h> #include <wiringPiI2C.h> unsigned short dig_t1,dig_p1; signed short dig_t2,dig_t3,dig_p2,dig_p3,dig_p4; signed short dig_p5,dig_p6,dig_p7,dig_p8,dig_p9; float temp,pres,var1,var2; int pres_int= 0 ,bmp280_flag=- 1 ; uint8_t msb,lsb,xlsb,pres_h= 0 ,pres_l= 0 ,pres_flo= 0 ; int i2c_fd; int Raspi_BMP280_Init() { wiringPiSetup(); i2c_fd=wiringPiI2CSetup( 0x76 ); if (wiringPiI2CReadReg8(i2c_fd, 0xd0 )== 0x58 ) { system ( "i2cset -y 1 0x76 0xff 0xf4" ); dig_t1=(wiringPiI2CReadReg8(i2c_fd, 0x89 )<< 8 )

DNS信息收集-dig

匿名 (未验证) 提交于 2019-12-03 00:07:01
命令: 所有DNS信息:dig mail.163.com any 筛选部分信息:dig +noall +answer mail.163.com | awk '{print &5}' 直接输出结果 追踪DNS:dig +trace www.sina.com @8.8.8.8 直接通过根域,com域,sina.com域迭代查询 可通过官网查询相关版本漏洞渗透该dns服务器,获取相关dns信息 FQDN:full qualified domain name 全限定域名,带有主机名和域名 域名记录:A(IPv4), AAAA(IPv6下的A地址)C Name,NS,MX,PTR 来源:博客园 作者: beyond_unknown 链接:https://www.cnblogs.com/unknownguy/p/11525294.html

dig常用命令解释

匿名 (未验证) 提交于 2019-12-02 23:57:01
@<服务器地址>:指定进行域名解析的域名服务器; 例:dig @1.2.4.8 www.baidu.com -b<ip地址>:当主机具有多个IP地址,指定使用本机的哪个IP地址向域名服务器发送域名查询请求; -f<文件名称>:指定dig以批处理的方式运行,指定的文件中保存着需要批处理查询的DNS任务信息; -P:指定域名服务器所使用端口号; -t<类型>:指定要查询的DNS数据类型; -x<IP地址>:执行逆向域名查询; -4:使用IPv4; -6:使用IPv6; -h:显示指令帮助信息。 实例: C:\Users\FFHK>dig @1.2.4.8 www.baidu.com ; <<>> DiG 9.15.3 <<>> @1.2.4.8 www.baidu.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19403 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 5, ADDITIONAL: 6 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION