• October 31, 2024, 11:40:11 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Pages: 1 2 3 [4]

Author Topic: DIR-645 unable to resolve names via DNS (DNS is working OK on internal network)  (Read 56653 times)

ambercap

  • Level 2 Member
  • **
  • Posts: 67

I know this forum is not for hacking or discussion of custom f/w for DLink products, and fixing a bug perhaps falls into a gray area, so if I'm not supposed to write about this here please let me know - I don't want to break any forum rules. :)

First of all, this is how I edited and tested the changes:

Whenever an interface comes up it raises the UPDATERESOLV event. This launches the script /etc/events/UPDATERESOLVE.sh, which in turn removes the DNS routes, launches UPDATERESOLV.php and adds the routes back again (via scripts created by UPDATERESOLV.php).

However /etc is on a read-only file system, so first I copied the files to /var which is a ramdisk (and flagged them as executable):
  cp /etc/events/UPDATERESOLV* /var
  chmod 755 /var/UPDATERESOLV*

Execute the script and check the result:
  /var/UPDATERESOLV.sh
  cat /etc/resolv.conf

Now how to easily edit and run the script? Fortunately the DIR-645 has a USB port. Just plug in a memory stick (FAT32) and it is automatically mounted as /var/tmp/storage/SanDisk_Cruzer_A1071 (or a similar name). It is the first time I've plugged in a memory stick, and I was surprised to see it automatically pop up on my Mac as a network drive called DIR-645 without me having to do anything. I think I already installed the SharePoint Plus utility that must have done that for me.  ;D

Now just copy the files to the memory stick:
  cp /var/UPDATERESOLV* /var/tmp/storage/SanDisk_Cruzer_A1071

Then open them on my Mac using XCode (free in the AppStore) and edit them.

First change the path in the UPDATERESOLV.sh script from /etc/events/UPDATERESOLV.php to /var/UPDATERESOLV.php.
Then make the changes in the php file itself. Odd cut down version of PHP - it does not allow things like parenthesis in an if statement to group logical operators...

Then copy the files back to /var and run it again until all is working as it should.
  cp /var/tmp/storage/SanDisk_Cruzer_A1071/UPDATERESOLV* /var
  /var/UPDATERESOLV.sh

Of course when the connection is restarted the original scripts run and not my version. To replace those read-only files I have to now build a new firmware.bin file (by editing the same file there) and upgrade the router. I'll have time on the weekend to do that. How? Just Google firmware-mod-kit and you will find all the info and tools described there (one has to use the newer version of the scripts with -ng in the name).
« Last Edit: January 24, 2013, 01:11:30 AM by ambercap »
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting

I think this could be ok since you are actually trying to fix something rather than trying to modify something that isn't broke persae. I think we'll call this a Modification.

Users will need to be aware that DLink will not officially support this and it's at Users own risk in attempting this modification and could void warranties.

I think the risk is fairly low and the modification to help clear up this DNS issue that seems to be with the DIR-645 and on your particular ISP.

Thank for sharing and hope this might help others with this condition.
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

ambercap

  • Level 2 Member
  • **
  • Posts: 67

Well I started up a new DIR-645 with the factory-shipped f/w 1.01, and let the wizard try configure it. It then tried to "detect internet settings" which I eventually had to cancel, and manually set to L2TP. Once connected it inserted the ppp DNS entries in resolv.conf followed by the ipv4 (dhcp) DNS, so DNS was working correctly and NTP succeeded, as did the DDNS update.

However as soon as the L2TP connection is reset or the router is rebooted, the order of the DNS entries switches round again to ipv4 first, followed by ppp, so DNS stops working.

Then I saw another strange bug, that happened the last time I connected a new router for the first time, and seems to get into an endless L2TP connect/disconnect loop, during which time only the correct ppp DNS entries are put into resolv.conf and not the ipv4 entries, but there is no internet connectivity. I think I'll describe this problem in more detail in a new thread (by this point I'd upgraded to 1.03 b11).

I also noticed some glitches in the wizard after the upgrade.
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting

Are you still thinking of changing from L2TP to DHCP?
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

ambercap

  • Level 2 Member
  • **
  • Posts: 67

Yes, I forgot to call them today - too caught up in work...
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting

I'm hoping moving to DHCP will help resolve this as I presume this is a bug with the FW when using L2TP.
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

ambercap

  • Level 2 Member
  • **
  • Posts: 67

I just successfully flashed my DIR-645 with a modified version of 1.03b11 and the DNS problems are fixed for L2TP! The new fix is a little different to what I tried before - I now add all DNS entries just as in the original f/w, but I ensure that PPP entries always come before DHCP entries so they have priority!
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting

Awesome man. Keep us posted on how it works and if you still swtich to DHCP ISP.
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

ambercap

  • Level 2 Member
  • **
  • Posts: 67

Since flashing my modified f/w, the router has been working perfectly for 2 1/2 days now. NTP, Dynamic DNS, all working flawlessly.

However tonight my ISP and the cable company upped me from 12/1Mb to 30/1.5Mb which meant they changed the connection from using L2TP to straight DHCP (based on the MAC of the modem).

So now I'm using DHCP and getting the correct DNS servers via the response. Everything still working great.

I'm just wondering about the speeds now (this should probably be under a new topic). From the modem I get 30Mb/s, and via the router LAN I get 30 too, but via WiFi I only get 15Mb/s. (I also have a LAN connection via a DLink DNP-308AV mains cable network extender and that gives me only 10Mb/s (with a red light indicating a poor mains connection at present).) Any idea how fast the WiFi should be?
« Last Edit: February 04, 2013, 01:19:55 PM by ambercap »
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting

Awesome. I think we could call this one resolved huh?  ::)
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

ambercap

  • Level 2 Member
  • **
  • Posts: 67

Yes definitely resolved (providing users are prepared to flash a custom f/w :) ).
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting

Does this not work with out using custom FW or does the FW still need to be modified if you using DHCP ISP services?
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

ambercap

  • Level 2 Member
  • **
  • Posts: 67

If using just DHCP then the router only receives the correct DNS via DHCP and custon f/w is NOT required.

If using L2TP with Dynamic IP (ie. on top of DHCP) then the custom f/w is needed to fix the DNS entries.
« Last Edit: February 05, 2013, 09:36:49 AM by ambercap »
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting

Awesome.

Thanks for the info man. Hope DHCP and the 645 work well for you now.
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.
Pages: 1 2 3 [4]