DNS以及dnsmasq 搭建 dns 局域网(1)

dns

ip地址的概念
如果你的电脑数量比较多尼?

明确每台机器出在网络的地址信息,明确每台电脑的门牌号
计算机在网络中发送数据的效果(送快递)
(你)得明确户主所在的小区地址,几号楼,单元号,几零几,快递才能送到别人手里

计算机发数据也得明确,目标机器所处的地址号码(ip地址应运而生)
ip地址就是用于标记计算机在网络中的地址信息,保证数据不会发送给别人
比如你向某局域网(192.168.178.1 发送数据,一定不会发送到 192.168.178.2 中)
ip地址的划分
(小区的门牌号举例),来理解,公网和局域网的概念
快递送到万达广场-6幢2单元304室,这句话准确吗?不准确。。。因为,每个地区都会有一个万达广场(好比局域网的概念)
必须明确指定,在这个中国唯一的一个地址,才能明确送到
送到江苏-淮安-万达广场-6幢2单元304室,这样地址明确了(如此概念就是公网ip地址的概念)

ip地址号码,主要分为四类 0-255

A类地址 ip地址范围 0.0.0.0~126.255.255.255 A类地址主要分配超大型公司的环境,比如苹果公司,阿里公司
B类地址 ip地址范围 128.0.0.0~191.255.255.255 此类地址主要分配给大型局域网公司环境,为何没有127?因为127是本地回环地址网段,被电脑内部占用了。
C类地址 ip地址范围 C类地址经常被学校,中小企业等环境使用,ip地址范围在192.0.0.0~223.255.255.255
D类地址 D类地址属于广播地址
E类地址 E类属于系统保留地址

####

公网地址和局域网地址的概念
如果省去了前缀,直接写简易的地址,如小区名,几幢,几单元,几零几,快递可能会直接打回你的东西,没法寄,找不到地方。
局域网的 ip 地址概念
局域网的ip地址好比一个小区的门牌号,用于在某一个群体内的数据交互的ip地址段,离开这个群体,这个ip也就失效了
如果这个小区名字是唯一的,全中国就一个,那么通过互联网查询系统,只有这唯一一个的小区门牌号,那么大家都那够找到你了,这个就是公网ip的概念
例如
公网ip:123.206.16.61 123.206.16.66
局域网ip地址:192.168.178.123 192.168.178.144
  • 如果A公司内部机器传输资料,192.168.10.12只需发给192.168.10.11即可
  • 如果A公司的某一个电脑,要发数据给B公司的某一个电脑,就得
    • A公司某一电脑数据发给公网ip
    • 然后再发送给B公司的公网ip
    • 然后再发给B公司的某一个局域网ip

什么是dns?

[网页浏览的原理]
大家日常上网的时候,打开的网页本质就是你从对方服务器上获取的文件,比如说你现在正在看的这篇文章,就存储在知乎的服务器上,你通过知乎客户端的浏览器,获取到了这些数据,并下载到了你的手机缓存当中,然后你的手机再把他们显示到屏幕上。
浏览网页的本质:就是下载文件,并将下载下来的网页文件变成你所能看到的图像。网页文件一般是 .html结尾的,不相信的话你可以用电脑浏览器,随便打开一个网站,右键空白处,网页另存为,然后你就会发现你存储下来了一个 .html结尾的网页文件,这时候你就算断网,双击这个网页文件你依旧可以用浏览器浏览,因为这个 html 文件被你保存到电脑上了。
所以浏览网页的原理就是:在互联网上找到了对方的电脑,然后从对方的电脑里拷贝出来 html 网页文件到你的电脑上,并将其转化成了文字和图片显示到显示器或手机上。
你从目标服务器上获取到了一个 html 网页文件而与,然后浏览器进行渲染,访问网站的域名,首先浏览器是进行了[域名解析:http://pythonay.cn/ -------------123.206.16.61 ]:80/index.html
浏览器直接访问 pythonay.cn
其实是被解析成了 123.206.16.61:80/index.html(即找到了这个文件)

[域名与IP的关系] [电话薄与名字的关系]

既然你要浏览网页需要在整个互联网上找到了对方的电脑,那你就需要输入对方的IP才可以访问,比如 大家可以在浏览器里输入这个ip地址 123.206.16.61 你们可以看看打开的是不是超哥的网站。是不是很有意思,你靠着IP地址可以访问网站,你输入www.pythonav.cn也可以上百度,这是什么原理呢?

在早期的时候,上网就是这么麻烦,你想要访问对方的网站,你必须要知道对方的IP,然后在你的浏览器里输入IP地址,然后就可以访问了,但是IP地址是4组数字,记IP地址的难度不亚于背一个陌生人的手机号,于是乎,我们用一串英文字母来代替IP地址,这就网站域名。
例如超哥的网站域名就是 www.baidu.com 对应的IP地址是 123.206.16.61,IP很难记忆,域名可以自定义很好记。
但是这里就有一个问题了,你输入的是域名,你的电脑该怎么将他变成IP地址呢?就比如你输入的是 www.pythonav.cn ,为什么你的电脑知道对方的IP是 123.206.16.61 呢?这个东西就是 hosts 文件,hosts 文件就在你的 C:\windows\system32\drivers\etc 文件夹下,linux 就是 /etc/hosts,他相当于电脑的电话本,他记录着没一个域名对应的IP地址,当你输入域名而不是IP的时候,他就会在这个电话本里找到对应的域名,然后把他转化成IP地址。

我们使用电话薄,名字----转化成了电话号码,因为名字更容易记住,电话不容易记住

域名是更容易被人们记住的字符串

ip地址比较隐晦,难以记住,因此,出现了各大互联网公司,企业,定制了一个 DNS 服务器。在一个 linux服务器上,安装了 dns 的服务端软件,他提供了一个[超大的电话薄]他其实就是一个key-value型的数据库,记录了域名----ip地址的对应关系

比如说

阿里 223.6.6.6 223.5.5.5

腾讯 119.29.29.29

114 114.114.114.114

谷歌 8.8.8.8

他们都分别提供了 dns 服务地址

比如你电脑上网特别慢,用某个网络优化工具,自动选择最优 dns 中...

如上的 dns 服务器地址,存放了大量的 域名的解析记录

[DNS解析服务器]

但是这样也有问题,那就是hosts文件是有限的,就和你不可能拥有这个世界上所有人的电话号码一样。即然我们自己不可能拥有全世界所有人的电话号码,但是我们可以将收集电话号码这个任务交给一个专门来干这个活的人,然后大家想要问电话的时候去他那查一下就可以了。
这就是DNS服务器,DNS服务器有着相当全的域名和IP,当你输入一串网站的时候,这串网站并不会直接访问,而是先将这个网站发送给DNS服务器,DNS服务器帮你把这串网站变成了IP地址,然后返回给你的电脑,你再访问这个IP地址,这样就解决了IP难记,而域名不能直接访问的问题了。
所以这样就可以解释文章开头那个故障了,你打不网页,却可以上QQ,因为上QQ不需要涉及到DNS解析服务,直接访问的就是腾讯服务器IP,但是你打开网页输入的是域名,而你的DNS 服务器输入错误或者DNS服务器炸了,所以你电脑不知道这串域名对应的IP,你自然就没法访问这个网站,而如果你手动直接输入IP,你依旧是可以访问网站的。

[什么是DNS劫持?]

那DNS服务器会告诉你A网站的IP是A,B网站的IP是B,那加入你输入的A网站域名,但是他给你B的IP,你是不是就访问到别的网站去了?
既然DNS服务器可以这么玩,我是不是可以将用户引导到我的网站上?比如你要看个电影,然后你输入了爱奇艺的官网,然后我作为 DNS 服务器,我把优酷的IP返回给你,最后就是虽然你输入了爱奇艺官网,但是却得到了优酷的IP并访问了优酷的IP,进入了优酷的网站上。
当然这里我只是举个例子,我举这个例子就是想告诉大家,DNS服务器想给你返回什么IP就给你返回什么IP,所以他可以在最后操作一些东西。最简单的就是广告,比如A网站没有广告,你直接访问就是没有的,但是你的DNS服务器把A网站下载下来了,给这个网站加个广告,然后重新上传到一个IP上,并把这个IP告诉了你,那就是你虽然输入的A网站的域名,但是你访问的是一个包含广告的复制版A网站,虽然两者功能一样,但是却完全不是一个服务器上的。

如何修改 Linux的 dns 配置

root@ubuntu:~# vim /etc/resolv.conf
root@ubuntu:~# cat /etc/resolv.conf
# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
search localdomain
nameserver 114.114.114.114

DNS域名解析服务

相较于由数字构成的IP地址,域名更容易被理解和记忆,所以我们通常更习惯通过域名的方式来访问网络中的资源。但是,网络中的计算机之间只能基于IP地址来互相识别对方的身份,而且要想在互联网中传输数据,也必须基于外网的IP地址来完成。
为了降低用户访问网络资源的门槛,DNS(Domain Name System,域名系统) 技术应运而生。这是一项用于管理和解析域名与IP地址对应的技术,简单来说,就是能够接受用户输入的域名或者IP地址,然后自动查找与之匹配(或者说具有映射关系)的IP地址或域名,即将域名解析为 IP 地址(正向解析),或将IP地址解析为域名(反向解析)。这样一来,我们只需要在浏览器中输入域名就能打开想要访问的网站了,DNS 域名解析技术的正向解析也是 我们最常使用的一种工作模式。
鉴于互联网中的域名和IP地址对应关系数据库太过庞大,DNS域名解析服务采用了类似目录树的层次结构来记录域名与IP地址之间的对应关系,从而形成了一个分布式的数据库系统。

DNS解析流程

先在自己脑海里过一遍有没有小度这个人的手机号,如果有直接拨出检查本地hosts文件
如果自己脑子想不起来,那么到手机通讯录里查找小度,看看有没有在通讯录里面存着,有的话直接拨出查找本地DNS解析器缓存
如果自己手机通讯录里面也没有,那该怎么办呢?找最近的营运商服务点啊,比如你家小区门口的移动营业厅,让他们帮助查询小度的手机号码查找首先DNS服务器
直接打给中国营运商总公司进行查询(因为只要是入网的他们都能查到) 有总公司直接返回给网点,再由网点返回给我。如果未用转发模式,本地DNS就把请求发至13台根DNS由根服务器返回
另一种就是这个网点接着上报给市营业厅.....,直到查询到并依次递归返回到网点,由网点交互如果用的是转发模式,此 DNS 服务器就会把请求转发至上一级DNS服务器,有上一级服务器进行解析,上一级服务器如果不能解析,或找根 DNS 或把转发请求转至上上级,以此循环。

域名后缀一般分为国际域名和国内域名。原则上来讲,域名后缀都有严格的定义,但在实际使用时可以不必严格遵守。
目前最常见的域名后缀有 .com(商业组织), .org(非营利组织),gov(政府部门),.net(网络服务商),.edu(教研机构),.Pub(公共大众),.cn(中国 国家顶级域名)等。
# 下载星巴克官网的index.html页面的代码
root@ubuntu:~# wget https://www.starbucks.com.cn/index.html
--2024-04-07 07:41:54--  https://www.starbucks.com.cn/index.html
Resolving www.starbucks.com.cn (www.starbucks.com.cn)... 61.170.79.235, 61.170.79.238, 61.170.79.231, ...
Connecting to www.starbucks.com.cn (www.starbucks.com.cn)|61.170.79.235|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27988 (27K) [text/html]
Saving to: ‘index.html’

index.html                              100%[=============================================================================>]  27.33K  --.-KB/s    in 0.001s

2024-04-07 07:41:54 (18.7 MB/s) - ‘index.html’ saved [27988/27988]

root@ubuntu:~# ls
index.html  snap
root@ubuntu:~# curl index.html

root@ubuntu:~# cat index.html

<!doctype html>
<html id="black">
<head>

  <title>星巴克 |
    用每一杯咖啡传递星巴克独特的咖啡体验</title>

  <!-- Meta -->

<meta charset='utf-8'/>
<meta http-equiv='Content-Language' content='zh'/>
<meta name='viewport' content='width=device-width, initial-scale=1'/>
<meta name='keywords' content='星巴克中国, 星巴克官网, 星巴克首页, starbucks.com.cn'/>
<meta name='description' content='欢迎访问星巴克中国官网。'>
<meta name='baidu-site-verification' content='u7Vir8pZFL' />
<link rel='canonical' href='/'>

<!-- Open graph -->
<meta property='og:site_name' content='星巴克'/>
<meta property='og:type' content='website'/>
<meta property='og:title' content='用每一杯咖啡传递星巴克独特的咖啡体验'/>
<meta property='og:url' content='/'/>
<meta property='og:description' content='欢迎访问星巴克中国官网。'/>
<meta property='og:image' content=''/>

<!-- Twitter card -->
<meta name='twitter:card' content='summary_large_image'/>
<meta name='twitter:site' content='{"username"=>"@starbucks"}'/>
<meta name='twitter:title' content='用每一杯咖啡传递星巴克独特的咖啡体验'/>
<meta name='twitter:description' content='欢迎访问星巴克中国官网。'/>
<meta name='twitter:image' content=''/>

<!-- WeChat sharing -->
<script>
  var WECHAT_TITLE = '星巴克官网: 用每一杯咖啡传递星巴克独特的咖啡体验';
  var WECHAT_DESC = '欢迎访问星巴克中国官网。';
  var WECHAT_IMAGE = '/assets/images/wechat.png';
  var WCHAT_NO_GA = '';
</script>


  <!-- Favicons -->
  <link rel='apple-touch-icon' sizes='180x180' href='https://www-static.chinacdn.starbucks.com.cn/prod/assets/favicons/apple-touch-icon.png'>
<link rel='icon' type='image/png' href='https://www-static.chinacdn.starbucks.com.cn/prod/assets/favicons/favicon-32x32.png' sizes='32x32'>
<link rel='icon' type='image/png' href='https://www-static.chinacdn.starbucks.com.cn/prod/assets/favicons/favicon-16x16.png' sizes='16x16'>
<link rel='manifest' href='https://www-static.chinacdn.starbucks.com.cn/prod/assets/favicons/manifest.json'>
<link rel='mask-icon' href='https://www-static.chinacdn.starbucks.com.cn/prod/assets/favicons/safari-pinned-tab.svg'>
<link rel='shortcut icon' href='https://www-static.chinacdn.starbucks.com.cn/prod/assets/favicons/favicon.ico'>
<meta name='msapplication-config' content='https://www-static.chinacdn.starbucks.com.cn/prod/assets/favicons/browserconfig.xml'>
<meta name='theme-color' content='#ffffff'>


  <!-- CSS -->
  <link rel='stylesheet' href='https://www-static.chinacdn.starbucks.com.cn/prod/assets/styles.css?202311282034'>
  <script async charset="UTF-8"
    src="https://active.starbucks.com.cn/sensorsdata/JS%20SDK/sa-sdk-javascript-1.22.7/sensorsdata.min.js"></script>
  <script charset="UTF-8">
    // 判断是否是首页是否开启黑白氛围
    let nowHref = window.location.href;
    let pathName = window.location.pathname;
    if (pathName == '/' || pathName == '/en/') {
      const isStg = nowHref.includes('web-staging')
      const isPrd = nowHref.includes('www.starbucks.com')
      portUrl = isStg ? `https://websitebff.stg.starbucks.com.cn/website` : isPrd ? `https://websitebff.starbucks.com.cn/website` : `https://websitebff.stg.starbucks.com.cn/website`
      var apiURL = '/anonymous/provision/white-black/config'
      var xhr = new XMLHttpRequest();
      xhr.withCredentials = true;
      xhr.open("GET", portUrl + apiURL);
      xhr.setRequestHeader("Content-Type", "application/json");
      xhr.setRequestHeader("x-signature", "1");
      xhr.send(null);
      xhr.onreadystatechange = function () {
        if (xhr.readyState === 4 && xhr.status === 200) {
          let data = JSON.parse(xhr.response)
          if (data?.data?.length > 0) {
            let htmlClass = document.getElementById('black')
            htmlClass.className = 'black'
          }
        }
      }

    }
    // H5埋点
    var sensors = window['sensorsDataAnalytic201505'];
    sensors.init({
      server_url: 'https://trackinghub.starbucks.com.cn/sa?project=production',
      heatmap: {
        scroll_notice_map: 'not_collect'
      },
      is_track_single_page: true,
      use_client_time: true,
    });
    sensors.quick('autoTrack');
  </script>
</head>

<style>
  .black {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
    filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
  }
</style>

<body
  class='lang-zh page-front'
  ontouchstart=''>
  <script>
var isChrome = ((navigator.userAgent.toLowerCase().indexOf('chrome') > -1) && (navigator.vendor.toLowerCase().indexOf('google') > -1) || navigator.userAgent.match('CriOS'));
if (isChrome) document.body.classList.add('chrome');
</script>

  <div id='app-view-wrapper'>
    <!-- Navigation panel -->





<nav id='nav'>
  <!-- <div class='terms-notes' id='terms-notes'>
    <p id='terms-notes-zh' style="display: none"><a href="/help/legal/starbucks-rewards-program-terms-and-conditions-2020">《星享俱乐部活动的条款和条件》即将更新并于2020年6月9日生效。您可以点击阅读,了解更多详情。</a></p>
    <p id='terms-notes-en' style="display: none"><a href="/help/legal/starbucks-rewards-program-terms-and-conditions-2020">The updated Starbucks Rewards Program Terms and Conditions will take effect on June 9, 2020. You can click here to review and learn more. </a></p>
  </div> -->
  <div id='placeholder-element'></div>
  <div class='container'>
    <header class='header'>
      <a class='logo' href='/'>
        <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/logo.svg' alt='星巴克'/>
      </a>
      <div class='primary'>
        <ul>

          <li class='stores'>
            <a id='stores-primary'  href='/stores/'>
              门店
            </a>
          </li>

          <li class='account'>
            <a id='account-primary'  href='/account/'>
              我的帐户
            </a>
          </li>

          <li class='menu'>
            <a id='menu-primary'  href='/menu/'>
              菜单
            </a>
          </li>

        </ul>
</div>

<a class='icon trigger' rel='nav-overlay' id='nav-menu'>
  <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-hamburger.svg'/>
  <span>更多</span>
</a>

    </header>

    <div class='body'>
      <div id='account-entry' class='container middle secondary'></div>

    </div>
  </div>


  <div class='overlay ' id='nav-overlay'>
  <div class='container'>
    <header class='header'>
      <a class='logo' href='/'>
        <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/logo.svg' alt='星巴克'/>
      </a>
      <button class='icon close'>Close</button>
    </header>
    <section class='body'>
      <div class='container middle'>
        <ul>

          <li>
            <a id='stores-overlay' href='/stores/' >
              门店
            </a>
          </li>


          <li>
            <a id='account-overlay' href='/account/' >
              我的帐户
            </a>
          </li>


          <li>
            <a id='menu-overlay' href='/menu/' >
              菜单
            </a>
          </li>
          <li><hr/></li>

          <li>
            <a id='apps-overlay' href='/apps/' >
              星巴克移动应用
            </a>
          </li>


          <li>
            <a id='svc-overlay' href='/starbucks-gift-card/' >
              星礼卡
            </a>
          </li>


          <li>
            <a id='starbucks_reserve-overlay' href='/starbucks-reserve/' >
              星巴克臻选™
            </a>
          </li>


          <li>
            <a id='starbucks_mop-overlay' href='/starbucks-now/' >
              啡快™ - 在线点 到店取
            </a>
          </li>


          <li>
            <a id='starbucks_delivery-overlay' href='/starbucks-delivers-info/' >
              专星送™
            </a>
          </li>


          <li>
            <a id='coffeehouse-overlay' href='/coffee-blog'  target='_blank'>
              咖啡星讲堂
            </a>
          </li>


          <li>
            <a id='roastery-overlay' href='https://roastery.starbucks.com.cn/'  target='_blank'>
              上海烘焙工坊
            </a>
          </li>


          <li>
            <a id='about-overlay' href='/about/' >
              关于星巴克
            </a>
          </li>


          <li>
            <a id='help-overlay' href='/help/' >
              帮助中心
            </a>
          </li>


          <li><hr/></li>
        </ul>
        <footer class='account'>
          <div id='account-logout'></div>
        </footer>
      </div>
    </section>
    <footer class='footer'>
      <div class='container'>





    <a id='en-collapse' class='lang' href='javascript:void(window.location.pathname = "/en/")'>
      English
    </a>



        |
        <a id='privacy-collapse' href='/help/legal/privacy-policy'>
          隐私政策
        </a>
        |
        <a id='terms-collapse' href='/help/legal/terms-of-starbucks-website/'>
          使用条款
        </a>
      </div>
    </footer>
  </div>
</div>

</nav>
<style>
  @media (min-width: 1025px) {
    #terms-notes {
      margin-left: 30%;
      width: 69%;
    }
    #placeholder-element {
      display: none;
    }
  }
  .terms-notes {
    position: fixed;
    display: none;
    width: 100%;
    padding: 4px 16px;
    background-color: #0bac69;
    z-index: 999;
  }
  .terms-notes p {
    margin: 0;
    padding-right: 18px
  }
  .terms-notes p a {
    width: 100%;
    margin: 0;
    color: #ffffff;
  }
</style>

<script>
  var pathname = window.location.pathname;
  var termsNotes = document.getElementById('terms-notes')
  if ((pathname === '/' || pathname === '') && termsNotes) {
      termsNotes.style.display = 'block';
      document.getElementById('terms-notes-zh').style.display = 'block';
      var placeholderElement = document.getElementById('placeholder-element');
      placeholderElement.style.height = termsNotes.offsetHeight + 'px';
  }
  if ((pathname === '/en' || pathname === '/en/') && termsNotes) {
    termsNotes.style.display = 'block';
    document.getElementById('terms-notes-en').style.display = 'block';
    var placeholderElement = document.getElementById('placeholder-element');
    placeholderElement.style.height = termsNotes.offsetHeight + 'px';
  }
</script>


    <!-- Page content -->
    <section id='content' style="padding-top: 0;">
      <div class='tag_ad' id="menu_ad">广告</div>
      <style>
  #app-promotion .close {
    display: none !important;
  }
  @media (max-width: 1024px) {
    #desktop-placeholder-element {
      display: none;
    }
  }

  .video-wrapper {
    text-align: center;
  }
</style>
<section class='hero'>
  <div id='desktop-placeholder-element'></div>
  <div class='carousel-home'>
    <!-- 改成mobile admin配置后,会丢失播放video的逻辑,因此先不删除 -->
    <!--
      <div>

        <a class='block relative' href='account/starbucks-rewards/'>

            <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/featured/club_upgrade/banner.jpg' class='carousel-image tablet-block mobile-hidden' />
            <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/featured/club_upgrade/banner_mobile.jpg' class='mobile-carousel-image show-mobile tablet-hidden' />

        </a>

      </div>

      <div>

        <a class='block relative' href='menu/'>

            <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/featured/default_banner/banner1.png' class='carousel-image tablet-block mobile-hidden' />
            <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/featured/default_banner/mobile_banner1.png' class='mobile-carousel-image show-mobile tablet-hidden' />

        </a>

      </div>
     -->
  </div>
</section>

<section class='promotion'>
  <div class='wrapper fluid'>
    <div class='grid columns-3 padded-2'>
      <!-- <a id='home-left-campaign' href='https://starbucks.m.tmall.com/' onclick='if (window.innerWidth >= 800) this.href="https://starbucks.tmall.com/";' target='_blank'><img src='https://www-static.chinacdn.starbucks.com.cn/prod/images/pages/tmall-2020-06-29-zh.jpg' /></a> -->
      <a id='home-left-campaign' target='_blank'><img id='home-left-campaign-img' /></a>
      <a id='home-middle-campaign' href='/design-studio/' target='_blank'><img src='https://www-static.chinacdn.starbucks.com.cn/prod/images/pages/starbucks-design-studio-web-china.jpg' /></a>
      <a id='home-right-campaign' href='/about/careers/' target='_blank'><img src='https://www-static.chinacdn.starbucks.com.cn/prod/images/pages/homepage-career-new.png' /></a>
    </div>
  </div>
</section>

<script type='text/javascript'>
  window._promotion_url = '';
  window._promotion_content = '';
</script>

<section class='program-msr bg-white'>
  <div class='wrapper'>
    <div class='grid columns-2 padded-2'>
      <div>
        <h2 class='wrapper-mobile'>星享俱乐部</h2>
        <p class='light wrapper-mobile'>开启您的星享之旅,星星越多、会员等级越高、好礼越丰富。<a id="home-msr-learn-more" class='button link' href='/account/starbucks-rewards'>了解更多 ›</a></p>
        <p class='flex flex-wrap justify-center tablet-justify-start items-center wrapper-mobile margin-b0'>
          <a id='home-msr-signup' href='/account/register/' class='button unlogged-in-element'>注册</a><a id='home-msr-login'  href='/account/' class='button secondary unlogged-in-element'>登录</a>
        </p>
      </div>
      <div class='image'>
        <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/logo-msr-20210601.svg' />
      </div>
    </div>
  </div>
</section>

<section class='tmall center'>
  <div class='wrapper'>
    <h2 class='wrapper-mobile'>星巴克精选</h2>
    <p class='light wrapper-mobile'>在星巴克天猫旗舰店发现更多咖啡心意</p>
    <ul class='grid columns-4 padded-2'>
      <li >
        <a id='home-tmall-msr' href='http://starbucks.tmall.com/p/rd796757.htm' target='_blank' class='tablet-block mobile-hidden' >
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/tmall-card-01-update.png' />
          <p class='title-1'><strong>会员星礼包</strong></p>
          <p class='margin2'>星享卡新升级<br/>更多心意好礼</p>
          <p class='caption'>了解更多 ›</p>
        </a>
        <a id='home-tmall-msr' href='http://tb.cn/wBOXXJw' target='_blank'  class='show-mobile tablet-hidden'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/tmall-card-01-update.png' />
          <p class='title-1'><strong>会员星礼包</strong></p>
          <p class='margin2'>星享卡新升级<br/>更多心意好礼</p>
          <p class='caption'>了解更多 ›</p>
        </a>
      </li>
      <li>
        <a id='home-tmall-svc' href='https://starbucks.m.tmall.com/shop/shop_auction_search.htm?spm=a1z60.7754813.0.0.55b01f1b3ATuTF&sort=default&shop_cn=%E8%99%9A%E6%8B%9F%E6%98%9F%E7%A4%BC%E5%8D%A1&ascid=1275566403&scid=1275566403' onclick='if (window.innerWidth >= 800) this.href= "https://starbucks.tmall.com/p/rd993825.htm?spm=a1z10.1-b-s.w5001-14489348230.6.MtuIoi";' target='_blank'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/tmall-card-02.png' />
          <p class='title-1'><strong>星礼卡</strong></p>
          <p class='margin2'>用一份心礼<br/>让心意相随</p>
          <p class='caption'>了解更多 ›</p>
        </a>
      </li>
      <li>
        <a id='home-tmall-drink' href='https://starbucks.m.tmall.com/shop/shop_auction_search.htm?spm=a1z60.7754813.0.0.387c1f1bxr89O6&sort=default&shop_cn=%E7%94%B5%E5%AD%90%E9%A5%AE%E5%93%81%E5%88%B8&ascid=1275566407&scid=1275566407' onclick='if (window.innerWidth >= 800) this.href= "https://starbucks.tmall.com/p/rd103766.htm?spm=a1z10.1-b-s.w5001-14489348230.8.MtuIoi";' target='_blank'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/tmall-eticket.png' />
          <p class='title-1'><strong>电子产品券</strong></p>
          <p class='margin2'>心意<br/>从这一杯开始</p>
          <p class='caption'>了解更多 ›</p>
        </a>
      </li>
      <li>
        <a id='home-tmall-coffee' href='https://starbucks.m.tmall.com/shop/shop_auction_search.htm?spm=a320p.7692363.0.0.7159451a5M4FwA&sort=default&shop_cn=%E5%92%96%E5%95%A1&ascid=1356509430&scid=1356509430' onclick='if (window.innerWidth >= 800) this.href= "https://starbucks.tmall.com/category-1141443816.htm?spm=a1z10.1-b-s.w4006-14489348233.10.MtuIoi";' target='_blank'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/tmall-reserve.png' />
          <p class='title-1'><strong>咖啡生活</strong></p>
          <p class='margin2'>星巴克<br/>用心制作</p>
          <p class='caption'>了解更多 ›</p>
        </a>
      </li>
    </ul>
  </div>
</section>
<section class='coffeehouse'>
  <div class='wrapper center'>
    <h2 class='wrapper-mobile'>1912 派克街 | 咖啡星讲堂</h2>
    <p class='light wrapper-mobile'>了解更多星巴克咖啡文化</p>
  </div>
  <div class='scroll-wrapper'>
    <div class='scroll-arrow scroll-arrow-left'>
      <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-scroll-left.svg' />
    </div>
    <div class='scroll'>
      <div class='wrapper'>
        <div class="scroll-items">
          <a id='home-blog-origin' target='_blank' href='/coffee-blog/the-origin-of-coffee-and-its-cultivation/' class='thumbnail rect card'>
            <div class='preview' style='background-image: url(https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/coffeehouse-coffee-cultivation-kv.jpg)'></div>
            <span class='tag'>咖啡知识</span>
            <!-- <time>08/07/2017</time> -->
            <strong>咖啡的起源与培植</strong>
          </a>
          <a id='home-blog-fundamentals' target='_blank' href='/coffee-blog/the-4-fundamentals/' class='thumbnail rect card'>
            <div class='preview' style='background-image: url(https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/coffeehouse-4-fundamentals-kv.jpg)'></div>
            <span class='tag'>咖啡品鉴</span>
            <!-- <time>08/07/2017</time> -->
            <strong>咖啡调制</strong>
          </a>
          <a id='home-blog-roast' target='_blank' href='/coffee-blog/roast-story/' class='thumbnail rect card'>
            <div class='preview' style='background-image: url(https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/coffeehouse-roast-story-kv.jpg)'></div>
            <span class='tag'>咖啡知识</span>
            <!-- <time>08/07/2017</time> -->
            <strong>咖啡烘焙</strong>
          </a>
          <a id='home-blog-pour' target='_blank' href='/coffee-blog/pour-over/' class='thumbnail rect card'>
            <div class='preview' style='background-image: url(https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/homepage/coffeehouse-pour-over-kv.jpg)'></div>
            <span class='tag'>咖啡品鉴</span>
            <!-- <time>08/07/2017</time> -->
            <strong>手冲咖啡</strong>
          </a>
        </div>
      </div>
    </div>
    <div class='scroll-arrow scroll-arrow-right'>
      <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-scroll-right.svg' />
    </div>
  </div>
</section>
<footer class="index-footer">
  <style>
    .index-footer {
      margin-bottom: -24px;
      background: #fff;
    }

    @media screen and (max-width: 640px) {
      .index-footer {
        margin-bottom: 0;
      }
    }

  </style>
  <script>
    var termsNotesDom = document.getElementById('terms-notes')
    if(termsNotesDom){
      var termsNotesHeight = termsNotesDom.offsetHeight;
      var placeholderElement = document.getElementById('desktop-placeholder-element');
      if(placeholderElement){
        placeholderElement.style.height = termsNotesHeight + 'px';
      }
    }

  </script>
  <style>
  .license {
    color: #666;
    font-size: 14px;
    text-align: center;
    line-height: 40px;
  }

  @media screen and (max-width: 640px) {
    .license {
      font-size: 12px;
    }
  }

  .license a {
    color: #666;
  }

  .license a:hover {
    color: #333;
  }
</style>
<div class="license">
  <span>
    <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=31010402000253" target="_blank">
      <img width="10" height="10" src="https://www-static.chinacdn.starbucks.com.cn/prod/assets/images/icpicon.png" />&nbsp;沪公网安备 31010402000253号
    </a>
  </span>
  |
  <a href="http://beian.miit.gov.cn" target="_blank">沪ICP备17003747号-1</a>
</div>
<!-- <div class='copyright'>© 2017 Starbucks Corporation.</div> -->
</footer>

      <div id='app-notification'></div>
    </section>
    <!-- banner-video begin -->
    <!-- <div class="banner-video" id="banner-video">
      <div class="close-video" id="close-video"><img src="../assets/icons/close-video.png" alt=""></div>
      <div class="iframe-video" id="iframe-video"></div>
    </div>
    <div id="video_container"></div>
    <script type="text/javascript" src="//vm.gtimg.cn/tencentvideo/txp/js/iframe/api.js"></script> -->
    <!-- banner-video end -->

    <div id='app-loading'></div>
    <div id='app-auth'></div>


  </div>
  <!-- Navigation bottom mobile -->
  <div class='primary-mobile'>
  <ul class='flex justify-around logging-in-element'>

    <li class='home' id='home-mobile'>
      <a href='/'



         class='active'

       >
        <span class='icons'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-home.svg'/>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-home-active.svg' class='active'/>
        </span>
        <div id='home-mobile'>主页</div>
      </a>
    </li>

    <li class='stores' id='stores-mobile'>
      <a href='/stores/'





       >
        <span class='icons'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-stores.svg'/>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-stores-active.svg' class='active'/>
        </span>
        <div id='stores-mobile'>门店</div>
      </a>
    </li>

    <li class='account' id='account-mobile'>
      <a href='/account/'





       >
        <span class='icons'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-account.svg'/>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-account-active.svg' class='active'/>
        </span>
        <div id='account-mobile'>我的帐户</div>
      </a>
    </li>

    <li class='menu' id='menu-mobile'>
      <a href='/menu/'





       >
        <span class='icons'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-menu.svg'/>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-menu-active.svg' class='active'/>
        </span>
        <div id='menu-mobile'>菜单</div>
      </a>
    </li>

    <li class='more' id='more-mobile'>
      <a class='icon trigger' rel='nav-overlay'>
        <span class='icons'>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-more.svg'/>
          <img src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/icons/icon-more-active.svg' class='active'/>
        </span>
        <div>更多</div>
      </a>
    </li>
  </ul>
</div>


  <!-- Javascript -->

  <!--[if lt IE 9
  ]><script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script
><![endif]-->
<script>
  var PAGE_LANG = 'zh';
  var PAGE_TITLE = '用每一杯咖啡传递星巴克独特的咖啡体验';
  var PAGE_URL = '/';
  var SEARCH_EMPTY = '未找到结果,猜你喜欢';
  var SEARCH_POPULAR = '大家都在搜';
  var SURVEY_URL = '';

  var stgUrl = 'https://artwork-assets-staging-sbux.starbucks.com.cn/mobile/componentization/index.html?pageId=70cf560b-223c-4042-b3be-4d462f3f4a09'
  var stgUrlEn = 'https://artwork-assets-staging-sbux.starbucks.com.cn/mobile/componentization/index.html?pageId=20d76622-3aba-4972-8033-6e6f547a7093'
  var prodUrl = 'https://artwork.starbucks.com.cn/mobile/componentization/index.html?pageId=eb495667-4c4b-4b41-b512-1ffc613149cc'
  var prodUrlEn = 'https://artwork.starbucks.com.cn/mobile/componentization/index.html?pageId=a9935562-081b-4bf9-8c40-d64a7d9d74db'

  const isStg = location.href.includes('web-staging')
  const isPrd = location.href.includes('www.starbucks.com')
  const isMenu = location.href.includes('menu')

  if(isMenu){
    var menuAd = document.getElementById('menu_ad')
    menuAd.style.display = 'none'
  } else {
    menuAd.style.display = 'block'
  }

  var iframeElement = document.getElementById('temporaryMenu');
  var iframeElementEn = document.getElementById('temporaryMenuEN');

  if(isStg){
    if(iframeElement) {
      iframeElement.src = stgUrl + '&time=' + Date.now();
    }
    if(iframeElementEn) {
      iframeElementEn.src = stgUrlEn + '&time=' + Date.now();
    }
  }
  if(isPrd){
    if(iframeElement) {
      iframeElement.src = prodUrl + '&time=' + Date.now();
    }
    if(iframeElementEn) {
      iframeElementEn.src = prodUrlEn + '&time=' + Date.now();
   }
  }
</script>

<script
  type="text/javascript"
  src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"
></script>

<script
  type="text/javascript"
  src="https://cards.starbucks.com.cn/esabxubs5h.js"
></script>
<script
  type="text/javascript"
  src="https://cards.starbucks.com.cn/prod/assets/js/esabxubs5hwen.js?"
></script>
<script
  type="text/javascript"
  src="https://cards.starbucks.com.cn/prod/assets/js/esabxubs5hwen.js?async"
  async
></script>

<script
  type="text/javascript"
  src="https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/base-bundle.js?202311282034"
></script>

<script
  type="text/javascript"
  src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/common.bundle.js?202311282034'
></script>
<script
  type="text/javascript"
  src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/vendor.bundle.js?202311282034'
></script>
<script
  type="text/javascript"
  src='https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/pages.bundle.js?202311282034'
></script>


<script
  type="text/javascript"
  src="https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/slick.min.js"
></script>
<script
  type="text/javascript"
  src="https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/home-base.js?v2"
></script>
<script
  type="text/javascript"
  src="https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/homepage.js?v6"
></script>
<script
  type="text/javascript"
  src="https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/tmall-banner.js?v6"
></script>
<script
  type="text/javascript"
  src="https://www-static.chinacdn.starbucks.com.cn/prod/assets/js/homepage-banner.js?v6"
></script>


<!-- <script src="https://browser.sentry-cdn.com/4.6.4/bundle.min.js" crossorigin="anonymous"></script> -->







</body>

</html>root@ubuntu:~#

浏览网页的原理就是

1. 通过互联网找到对方的机器

2. 然后从对方的机器中,找出对应的文件,下载到本地来

3. 通过浏览器渲染这样的数据

提供了一个[超哥的电话薄]。key-value类似的数据库,记录了域名---ip地址的对应关系

比如说
阿里云 223.5.5.5 223.6.6.6
腾讯 119.29.29.29
114 114.114.114.114
谷歌 8.8.8.8
分别都提供了 dns 服务器地址
比如 你电脑上网特别慢,用某个网络优化工具,自动选择最优 dns 中...
如上的 dns 服务器地址,存放了大量的 域名的解析记录

比如 www.baidu.com -----百度的 ip 地址
www.python.cn --------123.206.16.61
www.pythonay.com -------47.104.0.201

通过 nslookup 命令查看域名的解析关系
1. nslookup 该命令需要单独安装 dns 的套件软件包
# centos系统
yum instal bind-utils -y

# 在ubuntu上安装dns
root@ubuntu:~# apt install dnsutils -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  dnsutils
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
Need to get 3,926 B of archives.
After this operation, 59.4 kB of additional disk space will be used.
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates/universe amd64 dnsutils all 1:9.18.18-0ubuntu0.22.04.2 [3,926 B]
Fetched 3,926 B in 5s (771 B/s)
Selecting previously unselected package dnsutils.
(Reading database ... 92796 files and directories currently installed.)
Preparing to unpack .../dnsutils_1%3a9.18.18-0ubuntu0.22.04.2_all.deb ...
Unpacking dnsutils (1:9.18.18-0ubuntu0.22.04.2) ...
Setting up dnsutils (1:9.18.18-0ubuntu0.22.04.2) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@ubuntu:~# dig -v
DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu
root@ubuntu:~#


# dig命令可用于查询域名信息,如下
root@ubuntu:~# dig www.baidu.com

; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> www.baidu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29114
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;www.baidu.com.                 IN      A

;; ANSWER SECTION:
www.baidu.com.          5       IN      CNAME   www.a.shifen.com.
www.a.shifen.com.       5       IN      A       180.101.50.242
www.a.shifen.com.       5       IN      A       180.101.50.188

;; Query time: 11 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Sun Apr 07 08:26:09 UTC 2024
;; MSG SIZE  rcvd: 101

root@ubuntu:~#
2. 使用 nslookup 命令 是 nameserver lookup 域名服务器查找
# 非交互式
root@ubuntu:~# nslookup www.pythonav.cn
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   www.pythonav.cn
Address: 154.210.49.226

root@ubuntu:~#


# 交互式
root@ubuntu:~# nslookup
> www.pythonav.cn
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   www.pythonav.cn
Address: 154.210.49.226
>

> www.baidu.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
www.baidu.com   canonical name = www.a.shifen.com.
Name:   www.a.shifen.com
Address: 180.101.50.188
Name:   www.a.shifen.com
Address: 180.101.50.242
Name:   www.a.shifen.com
Address: 240e:e9:6002:15a:0:ff:b05c:1278
Name:   www.a.shifen.com
Address: 240e:e9:6002:15c:0:ff:b015:146f
>
# 星巴克
> www.starbucks.com.cn
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
www.starbucks.com.cn    canonical name = www.starbucks.com.cn.w.kunluncan.com.
www.starbucks.com.cn.w.kunluncan.com    canonical name = www.starbucks.com.cn.queniusa.com.
Name:   www.starbucks.com.cn.queniusa.com
Address: 61.170.79.236
Name:   www.starbucks.com.cn.queniusa.com
Address: 61.170.79.237
Name:   www.starbucks.com.cn.queniusa.com
Address: 61.170.79.231
Name:   www.starbucks.com.cn.queniusa.com
Address: 61.170.79.232
Name:   www.starbucks.com.cn.queniusa.com
Address: 61.170.79.233
Name:   www.starbucks.com.cn.queniusa.com
Address: 61.170.79.235
Name:   www.starbucks.com.cn.queniusa.com
Address: 61.170.79.234
Name:   www.starbucks.com.cn.queniusa.com
Address: 61.170.79.238
>
也可以直接 ping 命令查看 ip 对应关系
[linux 的 dns 配置文件]
1.linux 的本地 dns 解析文件, /etc/hosts 文件中,这个文件是运维人员自由定义域名和 ip 强制解析关系的。

vim /etc/hosts # 写入如下数据

127.0.0.1 www.pythonav.cn

ping www.pythonav.cn 解析到了 127.0.0.1 因此可以证明 hosts 文件的解析优先级高于 dns 客户端配置文件

root@ubuntu:~# vim /etc/hosts
root@ubuntu:~# ping www.pythonav.cn
PING www.pythonav.cn (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.032 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.024 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.030 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.022 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.022 ms
64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.023 ms
64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.026 ms
^C
--- www.pythonav.cn ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6135ms
rtt min/avg/max/mdev = 0.022/0.025/0.032/0.003 ms
root@ubuntu:~# tail -1 /etc/hosts
127.0.0.1  www.pythonav.cn
root@ubuntu:~#
2. /etc/resolv.conf 该文件,填入的是互联网 dns 服务器的地址
文件中定义了域名服务器地址,填入公网的 dns 服务器地址即可
root@k8s-master-10:~# cat /etc/resolv.conf
# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
search localdomain

3. 指定阿里解析域名

root@ubuntu:~# nslookup www.pythonav.cn 223.5.5.5
Server:         223.5.5.5
Address:        223.5.5.5#53

Non-authoritative answer:
Name:   www.pythonav.cn
Address: 154.210.49.226

root@ubuntu:~#


root@ubuntu:~# nslookup www.pythonav.cn 8.8.8.8
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   www.pythonav.cn
Address: 154.210.49.226

root@ubuntu:~#


dns 服务端的配置,以及什么是 dns 劫持
/etc/hosts 文件-----------自己本地的电话薄
/etc/resolv.conf---------填写 dns 服务器地址的配置文件---( 阿里云的dns服务器 收集了世界上所有的域名----IP的对应关系 )指定一个专门做电话号码收集的公司

这就是为什么QQ能聊天,而浏览器无法上网的问题所在了。

  • 20
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值