AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 661226
Accepted
dayuloli
dayuloli
Asked: 2015-01-22 05:56:23 +0800 CST2015-01-22 05:56:23 +0800 CST 2015-01-22 05:56:23 +0800 CST

ping 与 dig 中的 TTL

  • 772

当我跑的时候ping google.com,我得到一个ttl值55:

64 bytes from 173.194.127.103: icmp_seq=68 ttl=55 time=16.4 ms

当我运行dig google.com @ns1.google.com.时,它的TTL值为300.

google.com.     300 IN  A   173.194.127.34

为什么我得到两个不同的值TTL,哪一个在什么情况下是相关的?

domain-name-system
  • 2 2 个回答
  • 1256 Views

2 个回答

  • Voted
  1. Best Answer
    Sven
    2015-01-22T06:08:19+08:002015-01-22T06:08:19+08:00

    对于DNS, TTLwithping的含义完全不同。

    对于 DNS,这意味着一条记录在被认为太旧之前可以缓存多长时间。的值ping表示数据包在被丢弃之前可以接管不同网络的跳数。到达目标的路径上的每一跳都会将该值减 1,如果跳数过多,数据包将被丢弃。这是为了在配置错误的情况下防止数据包的永无止境的循环。

    我同意像谷歌这样的庞然大物必须竭尽全力并使用所有可用的技巧才能尽可能快地回答,这不是研究这个问题的好例子。

    • 5
  2. dmourati
    2015-01-22T20:14:08+08:002015-01-22T20:14:08+08:00

    从手册页 ping TTL 的附加上下文。

    TTL DETAILS
           The  TTL  value  of  an  IP  packet represents the maximum number of IP
           routers that the packet can go through before being  thrown  away.   In
           current  practice  you can expect each router in the Internet to decre-
           ment the TTL field by exactly one.
    
           The TCP/IP specification states that the  TTL  field  for  TCP  packets
           should  be set to 60, but many systems use smaller values (4.3 BSD uses
           30, 4.2 used 15).
    
           The maximum possible value of this field is 255, and most Unix  systems
           set the TTL field of ICMP ECHO_REQUEST packets to 255.  This is why you
           will find you can ‘‘ping’’ some hosts, but not  reach  them  with  tel-
           net(1) or ftp(1).
    
           In  normal  operation  ping  prints  the  ttl  value from the packet it
           receives.  When a remote system receives a ping packet, it can  do  one
           of three things with the TTL field in its response:
    
           · Not  change  it;  this  is  what Berkeley Unix systems did before the
             4.3BSD Tahoe release. In this case the  TTL  value  in  the  received
             packet  will  be  255  minus  the number of routers in the round-trip
             path.
    
           · Set it to 255; this is what current Berkeley  Unix  systems  do.   In
             this  case the TTL value in the received packet will be 255 minus the
             number of routers in the path from the remote system to  the  pinging
             host.
    
           · Set it to some other value. Some machines use the same value for ICMP
             packets that they use for TCP packets, for example either 30  or  60.
             Others may use completely wild values.
    
    • 0

相关问题

  • Solaris DNS

  • resolv.conf 在经过一段时间后被更改

  • 为什么有些网站的网址中没有“www”就无法显示?[关闭]

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve