zoukankan      html  css  js  c++  java
  • ubuntu设置ip和dns

     一、配置ip

         ubuntu的网络配置信息放在 /etc/network/interfaces 中,

        

         如果配置动态获取ip,则在上述文件中加入以下内容:

         auto eth0

         iface eth0 inet dhcp

     

         如果配置静态ip,则添加如下内容:

         auto eth0

         iface eth0 inet static

         address 192.168.33.201

         netmask 255.255.255.0

         gateway 192.168.33.1

     

         要是配置生效,需要重启网卡:

         ifconfig eth0 down

         ifconfig eth0 up

        

         不是root,命令前面加sudo

        

         接着用ifconfig命令查看ip是否配置成功

         /etc/init.d/networking restart

     

    二、配置dns服务器

             ubuntu dns服务器信息,放在 /etc/resolv.conf,

             添加dns服务器地址,如202.112.125.53,则在上述文件中加入

                 nameserver  202.106.0.20

  • 相关阅读:
    HDU-2502-月之数
    C语言的位运算的优势
    HDU-1026-Ignatius and the Princess I
    HDU-1015-Safecracker
    HDU-1398-Square Coins
    HDU-1028-Ignatius and the Princess III
    背包的硬币问题
    HDU-1527-取石子游戏
    HDU-1996-汉诺塔VI
    css中的选择器
  • 原文地址:https://www.cnblogs.com/evilloop/p/2182714.html
Copyright © 2011-2022 走看看