当前位置:网站首页>如何检查域名解析是否生效?
如何检查域名解析是否生效?
2022-06-11 03:54:00 【中科三方】
一、修改或添加解析后多久可以生效?
当添加或修改解析记录后,需同步至DNS服务器后才能生效,这个过程所需要的时间就是解析生效时间。
通常而言,新添加的解析记录,如果解析设置没有错误,添加成功后立即生效。
如果是对原有的解析记录进行修改,解析生效时间与修改之前设置的TTL值有关。例如在修改之前设置的TTL值是300s,那么修改记录之后,在300s内新记录就会生效。如果本地DNS不存在缓存时延,解析记录会立即生效。
二、如何检查域名解析是否生效?
1.使用ping命令检查域名解析是否已经生效(适用于Windows、Linux操作系统主机)
在本地主机上单击“搜索”,输入cmd,打开命令窗口。
然后输入以下命令检查解析是否生效。
Ping 域名
示例:检查域名example.com的解析是否生效
执行命令ping example.com
如果ping结果显示的IP地址和设置域名解析的IP地址保持一致,则说明解析已经生效。如果提示“请求不到主机”或者ping得到的IP地址与设置的IP地址不一致,则表明域名解析尚未生效或者域名解析设置错误。
2.使用nslookup命令检查域名解析是否生效(适用于Windows、Linux操作系统主机)
(1)验证A类型解析:用于指定域名的IP地址解析。
在本地主机单击“搜索”,输入cmd,打开命令窗口。
然后输入以下命令检查解析是否生效。
nslookup -qt=a 域名或nslookup 域名
示例:nslookup example.com
如果得到的IP地址和设置的域名解析IP地址保持一致,则表明域名解析已经生效。
如果找不到IP地址或者回显IP地址不一致,则表明域名解析未生效或设置错误。
(2)验证CNAME类型即系:用于指定域名的CNAME值,适用于CDN、WAF等场景。
通过“win+R”搜索命令,输入“cmd”打开命令操作窗口,然后通过以下命令检查解析是否生效
nslookup -qt=cname 域名
示例:nslookup -qt=cname example.com
如果显示的CNAME值与设置的CANME值一直,则表明域名解析已经生效。
如果得不到回传信息或者得到的CNAME值与设置的不一致,则表明域名解析设置错误或者尚未生效。
(3)验证MX类型解析:用于指定邮箱服务器的地址。
在本地主机单击“搜索”,输入cmd,打开命令窗口。
然后输入以下命令检查解析是否生效。
nslookup -qt=mx 域名
示例:nslookup -qt=mx example.com
如果得到的地址与设置域名解析的邮箱地址值一致,则说明解析已经生效。
(4)验证NS类型解析:用于指定解析服务商的 DNS 地址。
在本地主机单击“搜索”,输入cmd,打开命令窗口。
然后输入以下命令检查解析是否生效。
nslookup -qt=ns 域名
示例:nslookup -qt=ns example.top
如果得到的IP地址与设置解析域名的服务商的DNS地址一致,则说明解析已经生效。
三、域名解析常见问题
如果在以上几种验证解析生效的方法中无法获取正确的域名解析IP地址,则表明域名解析未生效或出现错误,这种情况我们在之前有过多次讨论,此处不作过多赘述。简单来说有以下几种情况:
1.由于域名过期、未实名等情况而产生域名状态异常,从而导致域名解析错误;
2.DNS解析缓存未刷新,导致无法获取最新的解析记录,这种情况下可执行ipconfig /flushdns命令刷新缓存;
3.如果域名解析正常,但是网站无法打开,这种情况就需要排查搭建网站的服务器是否正确绑定域名,或者网站是否完成备案。
域名解析是保障网站可以正常访问和使用的关键,所以一定要确保域名解析的设置正确,如果出现域名不生效及时联系域名服务商予以解决。
边栏推荐
- 如何做编程知识投资及减少知识失效的影响
- Management system of College Students' associations based on SSM
- Source Insight 4.0设置注释与反注释的快捷键
- NTP time server (GPS Beidou satellite synchronous clock) application boiler monitoring system
- Market prospect analysis and Research Report of welding laser in 2022
- 【SignalR全套系列】之在.Net6中实SignalR通信
- PMM monitoring Oracle
- 邪恶的CSRF
- Detailed explanation of network time synchronization (NTP network timing) of video monitoring system
- Benefits of declaring variables
猜你喜欢
![[network] socket programming](/img/df/2afc300bfc2dd319247a4b75ef7e2c.png)
[network] socket programming

Source insight 4.0 setting shortcut keys for comments and uncomments

ESP series module burning firmware

Exam item management system based on SSM

This artifact is highly recommended. One line command will convert the web page to PDF!

Shopping and retail backstage management system of chain supermarket based on SSM framework

Pictures that make people feel calm and warm

Guide de migration Maui

Two solutions for reliable message consistency
![[cnn]|differences between CNN and transformer](/img/ed/2b47387ba390a02c24bf9ff85b36e4.png)
[cnn]|differences between CNN and transformer
随机推荐
Exploitation and utilization of clickjacking vulnerability
编译原理笔记之词法分析器
合理使用线程池以及线程变量
SQL注入关联分析
Writing shell scripts using vscode
Final review of software engineering notes (short answer)
Shopping and retail backstage management system of chain supermarket based on SSM framework
【CNN】|How much position information do convolutional neural networks encode?
Matlab reports an error when trying to use * * * as a function problem, and tries to execute script PCA as a function:
Red team shooting range with three-layer protection
Samsung Galaxy S21 ultra and Apple iPhone 13 Pro Max: which one should you choose
How to invest in programming knowledge and reduce the impact of knowledge failure
软件工程笔记之期末复习(简答)
Market prospect analysis and Research Report of Ethernet scanner in 2022
Market prospect analysis and Research Report of digital line scan camera in 2022
密码找回功能可能存在的问题(补充)
Benefits of declaring variables
Application of NTP network time server (PTP clock synchronization) in it network
Code replicates CSRF attack and resolves it
Linq. pdf