0

I'm trying to build a DHCP and DNS server. I check that client ip is ok to capture (11.11.0.1), ping server ip (11.11.0.9) is ok, but ping domain name (example.com) is not ok.

On the server, ping IP is ok, ping domain name (example.com) is also ok.

Windows Client side: Command as ipconfig -all

連線特定 DNS 尾碼 . . . . . . . . : example.com
~~~
IPv4 位址 . . . . . . . . . . . . : 11.11.0.1(偏好選項)
子網路遮罩 . . . . . . . . . . . .: 255.255.255.0
~~~
預設閘道 . . . . . . . . . . . . .: 11.11.0.254
DHCP 伺服器 . . . . . . . . . . . : 11.11.0.9
~~~
DNS 伺服器 . . . . . . . . . . . .: fec0:0:0:ffff::1%1
                                    fec0:0:0:ffff::2%1
                                    fec0:0:0:ffff::3%1
NetBIOS over Tcpip . . . . . . . .: 啟用

CentOS Server side:
from DNS Server setting is not ok to grap, I added one line in "dhcpd.conf" as below:

subnet 11.11.0.0 netmask 255.255.255.0{
    option routers 11.11.0.254;
    option domain-name "example.com";
->  option domain-name-servers "11.11.0.9";
   };

Then ran "restart dhcp service" but it failed. /var/log/messages says:

 localhost dhcpd: /etc/dhcp/dhcpd.conf line 23: 11.11.0.9 (262): expecting IP address or hostname
 localhost dhcpd:     option domain-name-servers "11.11.0.9"

How should I solve this? I tried several IP combination to set, but still same result.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
結西卡
  • 3
  • 1

1 Answers1

1

Most likely, you have to remove the quotation marks around the statement, as IP addresses may not be quoted:

subnet 11.11.0.0 netmask 255.255.255.0{
    option routers 11.11.0.254;
    option domain-name "example.com";
    option domain-name-servers 11.11.0.9;
   };
Sven
  • 97,248
  • 13
  • 177
  • 225
  • Yes, I followed your suggestion to remove quotation marks. But Still can't ping example.com – 結西卡 Jun 08 '15 at 09:53
  • I converted this from a comment to an actual answer (which you should accept). Your ping problem is another question and should be posted as such. – Sven Jun 08 '15 at 09:55