2

I have connected Raspberry pi in my "D-link Router". Raspberry pi is getting IP is 192.168.0.102. And I have set this ip as fix from router.

I have host website on Raspberry pi. Now Router has no internet connection. My router is open for all.

All user connected to router can access the website which is hosted on Raspberry pi using IP address but not via host name.

All user cannot remember ip address. They can remember "raspberrypi" as hostname.

One more Thing, My Router is not supporting local dns option.

and I cannot use Package like Avahi. Because Android User cannot access ".local" in browser. Yes android has some utility. But I would not like to provide those strange solution.

Please guide how can I achieve this.

2

3 Answers 3

1

Considering your environment (no dns options on router and non-rooted Androids), there is little options. If you happen to own a domain name and have access to its nameserver, you could add a 'A'-record pointing to your raspberry IP like raspberry.example.org IN A 192.168.1.100

Disclaimer: While this will make your raspberry reachable in your local network, following the above way is generally discouraged and goes against IETF ruling IP Addresses that should never appear in the public DNS.

3
  • I would love to understand why this answer is getting downvoted.
    – EDP
    Aug 1, 2015 at 10:26
  • I think you mention it in your own answer: that this is a generally discouraged way to solve the problem.
    – WineSoaked
    Aug 10, 2015 at 0:56
  • 1
    I do understand your concern however, these are general practice rules dating from 2001 with very few newer COC's and RFC's referring to this since. It also says 'should never' and not 'must never'. It is 'generally discouraged'. If I'd buy a coffee for every large corporation violating RFC1034, RFC1035, general zone file/record cleanliness and TTL practices, I'd be bankrupt before the sun comes up. Therefore I'm sure that, if the OP implements this, chances are next to none that something bad happens.
    – EDP
    Aug 10, 2015 at 4:48
1

You could install a DNS-Server on your PI, i.e. bind. With webmin this is very easy and webmin offers a nice UI for configuration, too. But this has the downside that you'll have to configure the PI as (second) DNS server on every client (unless you can configure your router to publish your PIs DNS server via DHCP).

Or you add an entry for your PI in every clients hosts-file (under Windows it's located by default at c:\Windows\System32\drivers\etc\hosts; linux at /etc/hosts). Again, you'll have to do this on every client.

2
  • I would not like to make any change in client host file. Do you have any other workarounds? and How can I make change to mobile client?
    – banty
    Jul 18, 2015 at 4:24
  • This is perhaps your best option. You need to alter your local network to use the Raspberry Pi as the primary DNS server. This can be done inside the D-Link router's DHCP setup. Then you can create zone files that will permit you to reference "raspberrypi.xxx" or whatever top level domain you want to intercept. Be advised that this is something of a man-in-the-middle approach to DNS processing, so it's not great, but doesn't run afoul of IETF rules keeping private IP networks off of public DNS zones.
    – WineSoaked
    Aug 10, 2015 at 1:01
-2

Install and configure DNS on the Pi.

The install is simple "apt-get install dnsmasq dnsutils".
I did this on my Pi.

I am currently reading this How-To: http://blogging.dragon.org.uk/howto-setup-dnsmasq-as-dns-dhcp/ howto-setup-dnsmasq-as-dns-dhcp.

If you can't figure out how to configure your server Email me and I will work with you to resolve any issues.

Good luck.

Update: 0 down vote

Here is a fish plus how to fish: Raspbian_DNS_Server.

Email me if you have any trouble understanding my instructions.

5
  • 1
    can you send me best tutorial to configure dns in my scenario. Do I need server OS?
    – banty
    Jul 16, 2015 at 17:29
  • This may answer the question, but it should include the steps needed to accomplish this. As written it raises more questions than it answers. Jul 16, 2015 at 17:49
  • OK, here is what I did: Jul 18, 2015 at 23:16
  • Can't Email you banty, don't have your address. Jul 20, 2015 at 1:37
  • I can't imagine why this is downvoted. This is essentially the right answer.
    – WineSoaked
    Aug 10, 2015 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.