;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;image.qinjiangbo.com. IN A
;; ANSWER SECTION: image.qinjiangbo.com. 300 IN CNAME image.qinjiangbo.com.qiniudns.com. image.qinjiangbo.com.qiniudns.com. 300 IN CNAME tiny32.china.line.qiniudns.com. tiny32.china.line.qiniudns.com. 597 IN CNAME chinacdnweb.qiniu.com.w.kunlunno.com. chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 101.89.125.213 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 101.89.125.212 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 101.89.125.216 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 101.89.125.214 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 124.232.158.230 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 124.232.158.229 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 124.232.158.227 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 124.232.158.232 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 124.232.158.233 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 124.232.158.228 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 124.232.158.226 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 124.232.158.231 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 101.89.125.217 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 101.89.125.211 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 101.89.125.215 chinacdnweb.qiniu.com.w.kunlunno.com. 297 IN A 101.89.125.218
;; AUTHORITY SECTION: w.kunlunno.com. 86397 IN NS ns5.kunlunno.com. w.kunlunno.com. 86397 IN NS ns3.kunlunno.com. w.kunlunno.com. 86397 IN NS ns4.kunlunno.com.
File dir = new File(DEST_DIR); for (File f : Objects.requireNonNull(dir.listFiles())) { List<String> lines = Files.readLines(f, Charset.defaultCharset()); StringBuffer sb = new StringBuffer(); for (String s : lines) { sb.append(s).append("\n"); } String content = sb.toString().replaceAll(OLD_DOMAIN, NEW_DOMAIN); // 执行替换逻辑 Files.write(content.getBytes(), new File(f.getCanonicalPath())); }