I am trying to set up an apache web server on my vm and im running into some issues. When I do an 'nslookup' on the hostname of the machine this is what I get:
nslookup rhel64.xxxxx.xxxxx.com
Server: xxx.xxx.32.1
Address: xxx.xxx.32.1#53
** server can't find rhel64.xxxxx.xxxxx.com: NXDOMAIN
Run Code Online (Sandbox Code Playgroud)
I'm sure this is a common problem but I'm not sure how to fix it. It seems that dnsmasq can't resolve the hostname. Adding the hostname to /etc/hosts doesn't fix it. Running on …
有谁知道如何使用特定的 linux 命令获取 DNS 查询的原始输出?
我熟悉的命令是:
% 主持人
% nslookup
% 挖
% 谁是
但是,这些中的每一个都以某种形式使用 DNS,但是如何获得服务器 DNS 在查询时吐出的原始输出?
非常感谢!
我是Powershell脚本的新手,我需要编写一个脚本.我有一个服务器主机名列表,我需要获取这些服务器的IP地址并将结果写入文件.
主机名是Excel电子表格中的一列,但我可以将它们格式化为任何内容(csv,每行有一个主机名的简单txt文件等).
我想格式化输出的方式是服务器的主机名和每行的IP地址(因此,如果服务器有多个IP,则有多行).
到目前为止,我一直在使用每行主机名的简单文本文件,但是从PS的输出中我无法区分IP地址的服务器.
$servers = get-content "path_to_the_file"
foreach ($server in $servers) {
[System.Net.Dns]::GetHostAddresses($server)
}
Run Code Online (Sandbox Code Playgroud)
所以我想知道从csv文件加载主机名并再次将主机名和相关的IP地址打印到另一个csv,但我不确定如何.
我正在调查通过在foreach中运行nslookup $ server来捕获所需信息(主机名和IP)的可能性.
有人可以帮我一把吗?
谢谢.
使用代理时如何管理DNS查找?我尝试nslookupgoogle.com,但无法从我的本地DNS中找到它,那么使用简单的HTTP代理进行DNS查找的路径是什么?
我是脚本和R的新手.
在Windows cmd.exe中,我可以通过以下方式在域上执行NSLOOKUP:
nslookup www.google.com
我有一个域名数据集,我想验证它是有效的还是无效的,作为我在R中的分组过程的一部分.有没有办法在基础R或其中一个包中进行NSLOOKUP?
编辑1:我做了一些改动,使用建议的系统调用循环3个域.调用有效,但输出不会直接保存到向量中(下面的第7行).我怎么需要重新修改这一行才能捕获输出?
domains <- c('www.google.com','www.badtestdomainnotvalid.com','www.yahoo.com')
dns <- vector()
dnsreturn <-vector()
for(i in 1:length(domains)){
dns[i] <- paste('nslookup ',domains[i],sep='')
dnsreturn[i] <- system(dns[i],intern=TRUE)}
}
Run Code Online (Sandbox Code Playgroud) 主要是我想通过使用检测DNS是否在计算机上正确配置nslookup.遗憾的是,当nslookup无法查找条目时,它仍然会返回成功错误代码.此外,不同查询可能返回多个结果的事实使得测试它变得更加困难.
所以我想编写一个bash片段,如果dns条目成功解析,它会返回成功.如果我得到多个结果,我不在乎.
例 nslookup -type=srv _ldap._tcp.DOMAIN.COM
我跑的时候
echo `nslookup 100.100.100.100`
Run Code Online (Sandbox Code Playgroud)
在bash中,它列出所有文件(独立于(不存在的)ip地址).这是一个无证错误,或者发生了什么?
我确实意识到这里不需要回声.
hpek@hpek:~/temp/nslookupTest$ touch fil1.txt
hpek@hpek:~/temp/nslookupTest$ touch fil2.txt
hpek@hpek:~/temp/nslookupTest$ touch fil3.txt
hpek@hpek:~/temp/nslookupTest$ echo `nslookup 100.100.100.100`
Server: 10.10.10.1 Address: 10.10.10.1#53 fil1.txt fil2.txt fil3.txt server can't find 100.100.100.100.in-addr.arpa.: NXDOMAIN
hpek@hpek:~/temp/nslookupTest$
Run Code Online (Sandbox Code Playgroud) 我正在编写一个powershell来从服务器名称中确定ip,这需要我将nslookup代码嵌入到我的PowerShell中
我该如何进行整合工作?
有谁能够帮我?
Add-PSSnapin Microsoft.SharePoint.PowerShell
$web = Get-SPWeb -Identity “http://nycs00058260/sites/usitp“
$server_status = "PROD"
$list=$web.Lists[”DNS_Status”]
$items = $list.items
Foreach($item in $items){
$item_name = $item["Server_name"] #need to get the ip by this name
/*nslook up*/
$item_name.update()
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试将进程的输出读取为字符串.由于某种原因,它看起来像输出中间的一行似乎输出(即,它显示在屏幕上,而不是保存到字符串).
string strOutput = "";
Process process = new Process();
process.StartInfo.FileName = "nslookup";
process.StartInfo.Arguments = "-type=mx uic.edu";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
strOutput = process.StandardOutput.ReadToEnd();
process.WaitForExit();
Console.WriteLine("xxxxxxxxxxxxxxxxxxx");
Console.WriteLine(strOutput);
Console.WriteLine("yyyyyyyyyyyyyyyyyyy");
Run Code Online (Sandbox Code Playgroud)
我得到的输出看起来像这样:
Non-Authoritative answer:
xxxxxxxxxxxxxxxxxxxx
Server: aaa.myserver.com
Address: 111.222.111.222
uic.edu MX preference = 10, mail exchanger - ...
...
yyyyyyyyyyyyyyyyyyyy
Run Code Online (Sandbox Code Playgroud)
当我通过命令行运行命令时,"非权威答案:"在"地址:..."之后出现
有人可以解释为什么输出它,而不是作为字符串的一部分存储?我可能错过了一些明显的东西,但我很难过.
谢谢
我想要https://sfbay.craigslist.org的 IP 地址。
C:\Users\dude>ping https://sfbay.craigslist.org
Ping request could not find host https://sfbay.craigslist.org.
Please check the name and try again.
Run Code Online (Sandbox Code Playgroud)
所以,我尝试了 nslookup。输出中的 IP 均不允许我使用浏览器连接到该网站。如何获得正确的 IP 并连接?
C:\Users\nisum>nslookup https://sfbay.craigslist.org/
Server: cachens1.paetec.net
Address: 66.155.216.122
Non-authoritative answer:
Name: https://sfbay.craigslist.org/
Addresses: 104.239.198.84
198.105.254.65
Run Code Online (Sandbox Code Playgroud) 我在minikube集群中有一个k8s服务/部署(命名空间amq中的default名称:
D20181472:argo-k8s gms$ kubectl get svc --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
argo argo-ui ClusterIP 10.97.242.57 <none> 80/TCP 5h19m
default amq LoadBalancer 10.102.205.126 <pending> 61616:32514/TCP 4m4s
default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 5h23m
kube-system kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP 5h23m
Run Code Online (Sandbox Code Playgroud)
我打滑了Infoblox公司/ dnstools,并试图nslookup,dig和ping的amq.default结果如下:
dnstools# nslookup amq.default
Server: 10.96.0.10
Address: 10.96.0.10#53
Name: amq.default.svc.cluster.local
Address: 10.102.205.126
dnstools# ping amq.default
PING amq.default (10.102.205.126): 56 data bytes
^C
--- amq.default ping …Run Code Online (Sandbox Code Playgroud) 我试图从nslookup的输出中删除\n字符.虽然这看起来像一个简单的任务,但有许多关于过滤的帖子\n它们似乎对我不起作用.代码在Python 2.7中完美运行,但它不在3.6中
mx = str(subprocess.check_output(('nslookup -type=mx ' + "test.nl"), shell=True))
clean = re.sub(r"\n", " ", mx)
clean2 = mx.replace("\n", " ")
print(clean)
print(clean2)
Run Code Online (Sandbox Code Playgroud)
产量
\nNon-authoritative answer:\ntest.nl\tmail exchanger
Run Code Online (Sandbox Code Playgroud)
想要结果
Non-authoritative answer: test.nl\tmail exchanger
Run Code Online (Sandbox Code Playgroud)
这些都不起作用,但是当我删除'\'时,它会完美地过滤'n'.谁能告诉我我做错了什么?或者我如何才能达到想要的结果?
ps:知道这可能是重复的,我只是犯了一个愚蠢的错误,但是类似帖子中给出的解决方案对我不起作用.