Author Topic: rndc: connect failed: 127.0.0.1#953: connection refused บน centos หรือ red hat  (Read 6839 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Centos 6 มีปัญหาคือ ถ้ารัน command rndc reload
#rndc reload

จะเกิด error
rndc: connect failed: 127.0.0.1#953: connection refused

จากการตรวจสอบเหมือนกับว่า port 953 มีการใช้งานอยู่ เท่าที่เชคดู​ก็พบว่า มี daemon "portreserve" เปิดการทำงานและจอง port 953 อยู่
เลยทำการปิด service นี้ไป
#/etc/init.d/portreserve stop
#chkconfig --level 235 portreserve off

แล้วทำการ restart named
#/etc/init.d/named restart; tail -f /var/log/message

ก็ไม่เจอ error port 953 ชน
#rndc reload

ก็ไม่มี error อะไรฟ้องครับผม
« Last Edit: พฤษภาคม 27, 2017, 08:59:41 AM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: rndc: connect failed: 127.0.0.1#953: connection refused บน centos หรือ red hat
« Reply #1 on: สิงหาคม 08, 2014, 05:12:13 PM »
ถ้าดู log ของ named แล้วเจอแบบนี้ เกี่ยวกับ bad auth

Mar 22 16:26:26 s15248633 named[1831]: invalid command from 127.0.0.1#42186: bad auth
Mar 22 16:26:27 s15248633 named[1831]: invalid command from 127.0.0.1#42187: bad auth
Mar 22 16:26:28 s15248633 named[1831]: invalid command from 127.0.0.1#42188: bad auth

ในกรณีนี้ เกิดจาก configure rndc key ไม่ตรงกัน ที่ไฟล์ /etc/rndc.key กับ /etc/named.conf
ก็ทำการ generate rndc key อีกรอบโดยคำสั่ง

#rndc-confgen

แล้วก็ทำการปรับค่า key ให้ตรงกันซะ จากนั้นแล้วก็สั่ง ลบ process named และ lwresd ที่ใช้งานในปัจจุบันก่อน

#pkill lwresd
#pkill named

ทำการ restart named service 1 ครั้ง
#/etc/init.d/named start

named service ก็จะสามารถกลับมาทำงานได้ใหม่อีกครั้ง

#rndc reload
ก็ใช้งานได้ปกติครับผม  ลองดูนะครับ ;)
« Last Edit: สิงหาคม 08, 2014, 05:46:45 PM by golfreeze »