导航:首页 > IDC知识 > linux解析域名

linux解析域名

发布时间:2020-09-27 02:03:26

1、求一个linux shell脚本,把域名解析为ip然后echo出来。

|# ./get_ip.sh
./get_ip.sh need a parameter

# ./get_ip.sh e.cn
202.112.0.36

# cat get_ip.sh
#!/bin/sh

if [ $# -lt 1 ]; then
echo $0 need a parameter
exit 0
fi

ADDR=$1
TMPSTR=`ping ${ADDR} packetsize 1 | grep ${ADDR} | head -n 1`
echo ${TMPSTR} | cut -d'(' -f 2 | cut -d')' -f1

2、如何解决Linux无法解析域名问题

是所有域名都无法解析还是就单独的一两个无法解析。
要是全部都无法解析的话,建议更换DNS配置。
要是就一两个无法解析的话,建议把这两个域名添加到hosts里面。

3、linux 获取域名ip的方法

^1、用ping/nslookup/dig都能解析ip
2、实例getip.sh
#!/bin/sh
name=$1
if [ -z $1 ];then
echo Usage:$0 dns
exit 1
fi
dig $name|grep ^$name|awk '{print $5}'

3、./getip.sh 一个域名

4、linux bind,如何配置能够解析不带域名的host主机名。

从你提供的系统看你的bind应该是可以支持Response Policy Zone (RPZ) Rewriting策略的。
把主机名都写在rpz的zone里应该是可以实现的。
例如
response-policy { zone "badlist"; };

and this zone statement

zone "badlist" {type master; file "master/badlist"; allow-query {none;}; };

with this zone file

$TTL 1H
@ SOA LOCALHOST. named-mgr.example.com (1 1h 15m 30d 2h)
NS LOCALHOST.

; QNAME policy records. There are no periods (.) after the owner names.
server1 A 10.0.0.1

5、Linux下DNS无法解析问题

1、vi /etc/resolv.conf 在里面直接添加
nameserver 202.96.128.68 //DNS地址

2、查看路由:route -n看看网关是否正确

6、如何把域名解析到自己的linux主机

任何域名要访问网站都需要两个步骤,一是域名解析到空间IP上,而是空间绑定域名。。。你的阿里云在主机管理上会有一项绑定域名的,或者进入独立面板绑定。楼主做的什么站呐。

7、我的Linux不能解析域名怎么办?

我的是debian,
$
cat
/etc/resolv.conf
结果类似
nameserver
211.134.22.17
nameserver
211.10.17.5
您看一下这个文件内容,手动添加dns地址,就能解析的

8、linux操作系统访问域名需要配置什么吗?

redhat 系列配置dns 位置在 /etc/resolv.conf , resolv.conf 写法 :
nameserver 192.168.1.1
还要注意dns 的查询方式 /etc/nsswitch.conf :
hosts: files mdns4_minimal dns

9、Linux域名解析

你已经作对了啊,就是做A记录指到你的IP就行了。

只是生效需要一段时间而已。

刚Ping了一下,www.feelworld.com指向的IP是82.98.86.175,你的IP应该是173.231.6.89,那把这个A记录的IP改一下就行了

与linux解析域名相关的知识