Several days ago I got this error when I wanted to start a Listener:
TNSLSNR for Linux: Version 188.8.131.52.0 - Production System parameter file is /u01/app/oracle/product/11.2.0/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/cncldg1/listener/alert/log.xml Trace information written to /u01/app/oracle/diag/tnslsnr/cncldg1/listener/trace/ora_13916_140673552033600.trc TNS-12533: TNS:illegal ADDRESS parameters TNS-12560: TNS:protocol adapter error TNS-00503: Illegal ADDRESS parameters
It was very weird and I could not find the reason at that time. I made sure the listener.ora file was correct and when I created a test VM to verify this issue, I found I could not duplicate it.
I tried to find the root cause of this issue as I did not want to leave any uncertain things on the production server, so I enabled the Listener trace and also traced the progress using strace command. I found a little difference and I knew when the Listener tried to get host address information through getaddrinfo call, the returned value was different.
With the dig output, I got a more clear information:
[oracle@cncldg1 ~]$ dig @172.16.1.3 noexistt ; <<>> DiG 9.9.4-RedHat-9.9.4-51.el7 <<>> @172.16.1.3 noexistt ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 41808 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4000 ;; QUESTION SECTION: ;noexistt. IN A ;; Query time: 1 msec ;; SERVER: 172.16.1.3#53(172.16.1.3) ;; WHEN: Tue Nov 07 18:52:49 CST 2017 ;; MSG SIZE rcvd: 37
I do not know why the DNS server returns the SERVFAIL for not exist host, and normally the returned value should be NXDOMAIN:
[oracle@cncldg1 ~]$ dig @184.108.40.206 noexistt ; <<>> DiG 9.9.4-RedHat-9.9.4-51.el7 <<>> @220.127.116.11 noexistt ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 56644 ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;noexistt. IN A ;; AUTHORITY SECTION: . 86398 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2017110601 1800 900 604800 86400 ;; Query time: 53 msec ;; SERVER: 18.104.22.168#53(22.214.171.124) ;; WHEN: Tue Nov 07 18:54:10 CST 2017 ;; MSG SIZE rcvd: 112
I confirmed this result as changing the DNS server only.
In fact we had set hostname lookup with files first, why the DNS server affected the Listener?
In a word: because of the ipv6.
When ipv6 is enabled, the getaddrinfo call will try to get the address info through the ipv6 protocol first, and will fail as usually we do not place ipv6 mapping in the /etc/hosts file, then will check the DNS server. So the result of DNS lookup will affect the Listener. For ipv4, mostly we place the ip address mapping in the /etc/hosts file, so we could get the correct ipv4 address.
we could not change the DNS server, so below methods could be taken into account:
- Add the ipv6 ip address to the /etc/hosts file, easy and suggested.
- Using (IP=FIRST) in the listener.ora file
- Replace the hostname with ip address