can resolve hostname to IP Addr but CAN NOT resolve IP Addrs to name

Issues related to configuring your network
Post Reply
truongquyen
Posts: 4
Joined: 2019/02/20 05:04:47

can resolve hostname to IP Addr but CAN NOT resolve IP Addrs to name

Post by truongquyen » 2019/02/20 06:36:13

Dear all,

Follow this tutorial: https://www.unixmen.com/setting-dns-server-centos-7/
I set up the DNS server on a Cent OS 7. After finishing, I tried to test on the masterdns server: the server can resolve name to IP addr but can not resolve the IP addr to the name.
Anyone help me to fix that issue?
Note again: I do this test on that DNS server itself.
Tks,
NTQ

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can resolve hostname to IP Addr but CAN NOT resolve IP Addrs to name

Post by TrevorH » 2019/02/20 09:29:34

To resolve ip addresses to names you must configure a reverse zone.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

truongquyen
Posts: 4
Joined: 2019/02/20 05:04:47

Re: can resolve hostname to IP Addr but CAN NOT resolve IP Addrs to name

Post by truongquyen » 2019/02/21 07:08:30

Hi TrevoH,

I created the reverse file as below:

$TTL 86400
@ IN SOA master.ntqlab.com. root.ntqlab.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimium TTL
)

@ IN NS master.ntqlab.com.
@ IN PTR ntqlab.com.
master IN A 5.1.103.249
client IN A 5.1.103.164
249 IN PTR master.ntqlab.com.
164 IN PTR client.ntqlab.com.

truongquyen
Posts: 4
Joined: 2019/02/20 05:04:47

Re: can resolve hostname to IP Addr but CAN NOT resolve IP Addrs to name

Post by truongquyen » 2019/02/21 07:27:02

And this is the result I get:

[root@master ~]# nslookup
> master
Server: 5.1.103.249
Address: 5.1.103.249#53

Name: master.ntqlab.com
Address: 5.1.103.249
> client
Server: 5.1.103.249
Address: 5.1.103.249#53

Name: client.ntqlab.com
Address: 5.1.103.164
> 5.1.103.249
Server: 5.1.103.249
Address: 5.1.103.249#53

** server can't find 249.103.1.5.in-addr.arpa.: NXDOMAIN
> exit

[root@master ~]#

greys
Posts: 4
Joined: 2019/02/19 09:42:35

Re: can resolve hostname to IP Addr but CAN NOT resolve IP Addrs to name

Post by greys » 2019/02/21 09:32:05

Hi, think you got some bits of the reverse zone wrong. Here's how it should be:

Code: Select all

$TTL 86400
@ IN SOA master.ntqlab.com. root.master.ntqlab.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimium TTL
)

IN NS master.ntqlab.com.

249 IN PTR master.ntqlab.com.
164 IN PTR client.ntqlab.com.
After you update the file, don't forget to do rndc reconfig. Let us know!

truongquyen
Posts: 4
Joined: 2019/02/20 05:04:47

Re: can resolve hostname to IP Addr but CAN NOT resolve IP Addrs to name

Post by truongquyen » 2019/02/22 08:58:50

Hi Greys,

I've tried to modified the file and do rndc reconfig but it still can not work.
Event I reboot the server.
The file:

$TTL 86400
@ IN SOA master.ntqlab.com. root.master.ntqlab.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimium TTL
)

IN NS master.ntqlab.com.

249 IN PTR master.ntqlab.com.
164 IN PTR client.ntqlab.com.

And the result:

> master
Server: 5.1.103.249
Address: 5.1.103.249#53

Name: master.ntqlab.com
Address: 5.1.103.249
> 5.1.103.249
Server: 5.1.103.249
Address: 5.1.103.249#53

** server can't find 249.103.1.5.in-addr.arpa.: NXDOMAIN
>
Tks so much,
NTQ

Post Reply