大网数据广告活动
服务器运维问答

/etc/resolv.conf to overwrite local bind

· 52CE 我爱测

I have set up my /etc/bind to set up the following: dig @127.0.0.1 +noall +answer SRV _my-sub._tcp.example.com _my-sub._tcp.example.com. 300 IN SRV 0 0 12379 a0.example.com. _my-sub._tcp.example.com. 300 IN SRV 0 0 22379 a1.examp…

问题原文

原帖链接 · asdsadasdmes.1qwrnewkbjrkwj · CC BY-SA 3.0

I have set up my /etc/bind to set up the following:

dig @127.0.0.1 +noall +answer SRV _my-sub._tcp.example.com

_my-sub._tcp.example.com. 300 IN SRV 0 0 12379 a0.example.com.
_my-sub._tcp.example.com. 300 IN SRV 0 0 22379 a1.example.com.
_my-sub._tcp.example.com. 300 IN SRV 0 0 32379 a2.example.com.


dig @127.0.0.1 +noall +answer a0.example.com a1.example.com a2.example.com

a0.example.com. 300 IN  A   127.0.0.1
a1.example.com. 300 IN  A   127.0.0.1
a2.example.com. 300 IN  A   127.0.0.1

And now I want to edit my /etc/resolv.conf to get the same results without @127.0.0.1. How do I overwrite resolv.conf to achieve this?

Thanks!

dig +noall +answer a0.example.com a1.example.com a2.example.com

Should return:

a0.example.com. 300 IN  A   127.0.0.1
a1.example.com. 300 IN  A   127.0.0.1
a2.example.com. 300 IN  A   127.0.0.1

已采纳解答

原帖链接 · user9517 · CC BY-SA 3.0

You can either remove all nameserver references from your resolv.conf or you can add a specific

nameserver 127.0.0.1 

to your file. Note that if you add multiple nameserver entries they are tried in the order they are defined. Note also that the maximum is currently three.

You should probably read the documentation, resolv.conf(5).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。