ubuntu12.04.4添加静态DNS并更改默认源为163源
来源:互联网 发布:算法复杂性影响因素 编辑:程序博客网 时间:2024/06/14 23:23
1.添加静态DNS地址
网上大部分都是一样的设置,说是在/etc/resolvconf/resolv.conf.d/目录下建立base文件,内容如下
cd /etc/resolvconf/resolv.conf.d/
cat base
nameserver 8.8.8.8
这样不是不行,但最简单的办法我觉得应该像下面的这样,直接在gateway下添加dns-nameservers 8.8.8.8
root@ubuntu:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.78.11
netmask 255.255.255.0
gateway 192.168.78.2
dns-nameservers 8.8.8.8 8.8.4.4
root@ubuntu:~#
这样静态DNS就添加好了
2.更改默认源为163源
首先备份默认源
root@ubuntu:~# cd /etc/apt/
root@ubuntu:/etc/apt# cp sources.list sources.list.bak
然后修改为163源,内容如下
deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
然后就可以更新源,安装软件了
- ubuntu12.04.4添加静态DNS并更改默认源为163源
- ubuntu系统默认源更改为阿里源
- ubuntu系统更改默认软件源为网易软件源
- 选择默认程序--添加无效--强制更改,ps为例
- Centos更改为163源
- Ubuntu12.04更改源的方
- Apache: 启用mod_expires为静态资源添加默认过期
- 添加新的键盘apk并设置为默认键盘
- Android 系统添加输入法并设置为默认输入法
- JavaScript阻止浏览器默认事件,并将回车更改为TAB效果
- 更改centos6为静态IP
- centos 6.4更改为163源
- Centos6如何更改yum源为163
- Centos系统更改yum源为163
- Centos系统更改yum源为163
- Centos系统更改 yum源为163
- 各个版本Linux更改为163源
- ubuntu12.04配置静态IP及设置DNS
- bzoj 1324: Exca王者之剑
- 打造个人营销知名度的5大法则
- SpannableString与SpannableStringBuilder
- 并发的着眼点
- 设计模式(二)---工厂方法模式
- ubuntu12.04.4添加静态DNS并更改默认源为163源
- 嵌入式MCU多功能的USART--基本串口功能
- android示例之SQLite基础——事务
- Distinct Subsequences leetcode
- Cocos2dx 利用ClippingNode 做遮罩
- sizeof计算二维数组长度的问题
- bzoj 1726: [Usaco2006 Nov]Roadblocks第二短路
- B树索引
- [题目] Section 1.2 Milking Cows(USACO)