Modify

Opened 7 years ago

Last modified 4 years ago

#8562 new defect

DDNS update nslookup failure

Reported by: quiet.dragon@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

There are several problems with the use of nslookup in dynamic_dns_updater.sh

  1. The regular expression matching wrongly seeks the Name output of nslookup rather than Address.

This causes the script to update DDNS entry on each restart even if unnecessary.

  1. Multiline Address output confuses the matcher.
  1. No provision is made to use a particular DNS server.

The last is important because it might take some time for the DNS record to propagate from the DDNS server to the ISP DNS server.

This patch parses the output of nslookup and seeks the first Address entry.

Attachments (3)

ddns.diff.txt (1.7 KB) - added by quiet.dragon@… 7 years ago.
nslookup patch
dynamic_dns_updater.sh.diff.txt (507 bytes) - added by quiet.dragon@… 7 years ago.
Patch to correct handling of nslookup output
ddns-1.diff.txt (1.7 KB) - added by quiet.dragon@… 7 years ago.
Updated patch

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by quiet.dragon@…

nslookup patch

comment:1 follow-ups: Changed 7 years ago by jow

Point 3 will be difficult to fix as the busybox nslookup just ignores any command line provided ns server.

comment:2 in reply to: ↑ 1 Changed 7 years ago by anonymous

Replying to jow:

Point 3 will be difficult to fix as the busybox nslookup just ignores any command line provided ns server.

Oh dear. I now see:

https://forum.openwrt.org/viewtopic.php?id=13917

I started working on a lua version of nslookup-lite and abandoned it thinking that dynamic_dns_updater.sh with the fixes above might be good enough.

Let me redo the patch to just address points (1) and (2).

I'll leave (3) for another day.

comment:3 in reply to: ↑ 1 Changed 7 years ago by quiet.dragon@…

Replying to jow:

Point 3 will be difficult to fix as the busybox nslookup just ignores any command line provided ns server.

Ok. I've attached a patch that just addresses points (1) and (2).

Changed 7 years ago by quiet.dragon@…

Patch to correct handling of nslookup output

comment:4 Changed 7 years ago by quiet.dragon@…

I did some snooping of the behaviour of nslookup on the trunk and it seems to be behaving properly and querying the target server.

# nslookup www.yahoo.com 8.8.8.8

08:35:43.074710 IP (tos 0x0, ttl 64, id 15971, offset 0, flags [DF], proto UDP (17), length 66)
    207.216.85.106.45241 > 8.8.8.8.53: 2+ PTR? 8.8.8.8.in-addr.arpa. (38)
08:35:43.114663 IP (tos 0x0, ttl 53, id 6564, offset 0, flags [none], proto UDP (17), length 110)
    8.8.8.8.53 > 207.216.85.106.45241: 2 1/0/0 8.8.8.8.in-addr.arpa. (82)
08:35:43.115686 IP (tos 0x0, ttl 64, id 15975, offset 0, flags [DF], proto UDP (17), length 59)
    207.216.85.106.48974 > 8.8.8.8.53: 3+ AAAA? www.yahoo.com. (31)
08:35:43.183175 IP (tos 0x0, ttl 53, id 51335, offset 0, flags [none], proto UDP (17), length 168)
    8.8.8.8.53 > 207.216.85.106.48974: 3 2/1/0 www.yahoo.com. CNAME[|domain]
08:35:43.183700 IP (tos 0x0, ttl 64, id 15982, offset 0, flags [DF], proto UDP (17), length 64)
    207.216.85.106.58738 > 8.8.8.8.53: 4+ AAAA? fp.wg1.b.yahoo.com. (36)
08:35:43.298668 IP (tos 0x0, ttl 53, id 26949, offset 0, flags [none], proto UDP (17), length 150)
    8.8.8.8.53 > 207.216.85.106.58738: 4 1/1/0 fp.wg1.b.yahoo.com. CNAME[|domain]
08:35:43.299179 IP (tos 0x0, ttl 64, id 15993, offset 0, flags [DF], proto UDP (17), length 68)
    207.216.85.106.41178 > 8.8.8.8.53: 5+ AAAA? any-fp.wa1.b.yahoo.com. (40)
08:35:43.374030 IP (tos 0x0, ttl 53, id 56633, offset 0, flags [none], proto UDP (17), length 129)
    8.8.8.8.53 > 207.216.85.106.41178: 5 0/1/0 (101)
08:35:43.374603 IP (tos 0x0, ttl 64, id 16001, offset 0, flags [DF], proto UDP (17), length 59)
    207.216.85.106.41978 > 8.8.8.8.53: 6+ A? www.yahoo.com. (31)
08:35:43.412751 IP (tos 0x0, ttl 53, id 11586, offset 0, flags [none], proto UDP (17), length 139)
    8.8.8.8.53 > 207.216.85.106.41978: 6 4/0/0 www.yahoo.com. CNAME[|domain]
08:35:43.413419 IP (tos 0x0, ttl 64, id 16005, offset 0, flags [DF], proto UDP (17), length 69)
    207.216.85.106.59164 > 8.8.8.8.53: 7+ PTR? 43.2.30.72.in-addr.arpa. (41)
08:35:43.453390 IP (tos 0x0, ttl 53, id 11587, offset 0, flags [none], proto UDP (17), length 107)
    8.8.8.8.53 > 207.216.85.106.59164: 7 1/0/0 43.2.30.72.in-addr.arpa. (79)
08:35:43.454057 IP (tos 0x0, ttl 64, id 16009, offset 0, flags [DF], proto UDP (17), length 72)
    207.216.85.106.50817 > 8.8.8.8.53: 8+ PTR? 56.149.137.98.in-addr.arpa. (44)
08:35:43.493550 IP (tos 0x0, ttl 53, id 56634, offset 0, flags [none], proto UDP (17), length 110)
    8.8.8.8.53 > 207.216.85.106.50817: 8 1/0/0 56.149.137.98.in-addr.arpa. (82)

Changed 7 years ago by quiet.dragon@…

Updated patch

comment:5 Changed 7 years ago by quiet.dragon@…

Updated patch to reinstate DNS server option, and correct syntax error.

comment:6 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.