我们在ubuntu下经常会遇到以下问题
1. windows下ping ubuntu的机器名ping不到
2. ubuntu下ping windows下的机器名 ping 不到
3. ubuntu下ping ubuntu下的机器名ping不到
以上就是碰到了name server的问题了
首先, 我们要理清楚以下几个问题
1. windows是如何根据name寻找ip的
2. ubuntu是如何根据name寻找ip的
3. mac呢
name到ip的映射有以下几个方式
1. /etc/hosts的方式, 用户自行配置的, 优先级最高
2. wins windows用于解析名字的服务
3. mdns 是apple发明的, ubuntu下也可以使用
4. dns服务, 通常由ISP提供, 一般局域网搜不到, 就要去外网搜了
另外:
wins 的服务, 有时会有域服务器来提供服务
由此: windows 与 ubuntu 下互通name, 需要敲定要走 wins还是mdns
1. windows 下默认支持 wins 服务, 有服务器,也有客户端支持
2. ubuntu下走wins, 可以安装 samba , 由 nmbd服务器提供服务端
3. ubuntu 下 ping wins, 可以在 smb.conf 下配置 wins server
4. windows 下走 mdns 服务, 可以安装apple的itunes, 由bonjour提供服务端
5. ubuntu 下安装 mdns服务, 可使用 avahi-demon 来提供 mdns 服务
6. ubuntu 下解析 mdns, 可以在 /etc/resolv.conf 中配置, 由 dnsmasq 来提供解析
7. mac 上默认提供了 mdns 与 wins
因此, 不动 windows, 可以在 ubuntu 中安装以下服务
sudo apt-get install samba
sudo apt-get install avahi-daemon
sudo apt-get install libnss-mdns ##necessary?
sudo vi /etc/nsswitch.conf (hosts: files mdns4_minimal dns)
sudo vi /etc/samba/smb.conf
sudo service smbd restart
sudo service nmbd restart
//sudo service avahi-daemon restart
sudo dnsmasq
sudo service networking restart
如果ubuntu一直ping不通mac.local or ipad.local,请尝试重启
这样, 在 windows, ubuntu, mac 下互相ping hostname就OK了
补: mdns 的ping时, 要加 .local
相关的命令有: ping nslookup host dig nbtscan nmblookup nmap
sudo netstat -ntp
sudo ss -nlt
相关的文件有:
/etc/resolv.conf
/etc/nsswitch.conf
/etc/NetworkManager/NetworkManager.conf
https://wiki.archlinux.org/index.php/Avahi
分享到:
相关推荐
This book is designed as an Ubuntu 15.04 server reference, covering the Ubuntu servers and their support applications. Server tools are covered as well as the underlying configuration files and system...
如果要关闭root用户,仅需运行sudo passwd –l root即可。...root帐号和普通帐号的sudo不同之处在于,使用...使用命令sudo passwd user-name,然后根据提示输入sudo密码,如果验证通过,则会提示为user-name输入新密码。
使用Ubuntu Server 20.04.2 LTS设置树莓派4的说明 将Ubuntu刻录到micro SD 下载Ubuntu Server 20.04.2 LTS 我正在使用Balena将ubuntu安装到microSDCard中 从microSd启动 用户ubuntu密码ubuntu 您将要求更新密码 ...
git clone -b $DISTRIB_CODENAME git://github.com/lmbbox/Ubuntu-Server-Deploy.git deploy 要在下次登录时设置脚本: sudo deploy/reset.sh 要手动运行脚本: sudo deploy/deploy.sh 构建 VMware 模板 按照...
Install and configure common standard services such as web, mail, FTP, database and domain name server technologies Create kickstart scripts to automatically deploy RHEL 7 systems Use Orchestration ...
deb包完美进行离线安装docker,适用于ubuntu系统,Kylin系统,给出安装过程有可能缺少库依赖的解决办法,以后对于deb包缺少以赖库都可以用此方法
本程序基于 Ubuntu 镜像构建,相当一个 Ubuntu 虚拟机。里面已经安装好了 MySQL 源码开发的环境。启动容器镜像后可以直接进行开发、调试、测试工作。# 1、先确保本地已经安装和启动 docker,请确保 docker 的根目录...
ubuntu18.04系统下VScode server ,change this name to .vsocde_serverj.20210422
厨师服务器Chef-server将在Ubuntu Trusty 14.04 LTS容器中运行Chef Server 12。 图像大小:大约1GB 这是一个分支: 。环境协议/端口Chef默认情况下通过HTTPS / 443运行。 但是,您可以通过在下面的-e SSL_PORT=new_...
DNS(Domain Name Server,域名服务器)是进行域名(domain name)和与之相对应的IP地址 (IP address)转换的服务器。DNS中保存了一张域名(domain name)和与之相对应的IP地址 (IP address)的表,以解析消息的域名。 ...
Roon Docker映像 用于roon的Docker映像。 ... --name=roon-server \ -v </path>:/config \ -v </path>:/music \ --restart unless-stopped \ jmmaloney4/roon:latest Kubernetes舵图 舵图见 。
用法在您的主要Yaml文件中: - name: Server name roles: - ssh-server在您的host_vars/servername.example.com.yml文件中: sshd_config_password_authentication: falsesshd_config_x11_forwarding: falsesshd_...
@@server found, requesting user name... >>sending user name... @@user name valid, requesting password... >>sending password... @@Password valid, authentication SUCCESS!!!:) Keeping sending echo...
该Docker映像是带有MapServer设置的容器,具有MapServer套件,基于Ubuntu 14.04和UbuntuGIS软件包。 构建和/或运行容器 Git克隆此存储库以获取Dockerfile,并对其进行cd。 您可以使用以下命令构建图像: sudo ...
操作系统 server.os().name; // Ubuntuserver.os().version; // 14.04内存使用情况 server.memory().total; // 1.96GBserver.memory().used; // 510MBserver.memory().free; // 1.46GBserver.memory().active; // ...
ansible-playbook -i "yourhostname," -e "hostname=your_host_name" --ask-sudo-pass rescue_reinstall_arch_linux.yml 如果您只想通过 Ubuntu Live 在/dev/sda上调试您的 arch root,那么此命令将使其在 /tmp/...
ssh root@SERVER "./rails-passenger-postgres-nginx app_name db_pass" 如果出现错误“ No PostgreSQL clusters exist ,则应配置区域设置: 在/ etc / default / locale中: LANG=en_US.UTF-8 LANGUAGE=en_US....
一. Samba 简介 Samba(SMB是其缩写) 是一个网络服务器,...以上几步,对于简单使用ubuntu和windows的文件共享于互访已经足够,更详细的资料可以参考:http://linux.vbird.org/linux_server/0370samba.php#server_pkg
NGINX-SSL 在 Ubuntu 14.04 机器上使用自签名 SSL 证书配置 NGINX 的简单脚本。 Basic usage: sudo ... Default is 5000.-s [SERVER] --Sets the value for the server name. Default is the IP address.-h --Displa