PT_*_*T_C 4 apache nslookup dnsmasq hosts
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 an RHEL6.4 machine. Thanks in advance.
You should use a DNS server that is able to resolve the name; the one you are using now, at xxx.xxx.32.1, isn't.
Adding the hostname to /etc/hosts doesn't fix it.
This is because nslookup does a DNS lookup always, it does not read the hosts file. Try using getent instead, for example I get:
$ getent hosts rhel64.xxxxx.xxxxx.com
176.74.176.178 rhel64.xxxxx.xxxxx.com
Run Code Online (Sandbox Code Playgroud)
(By the way, you should use example.com as an example almost always, so you don't inadvertently link to adult-only websites)
| 归档时间: |
|
| 查看次数: |
27206 次 |
| 最近记录: |