Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i'm setting up a testing environment in my office and configured a router flashed with dd-wrt to be my dns. I configured the domain name in the router to mydomain.com, through Setup >> Basic Setup >> Optional Settings. I also have a web server with the hostname configured to www through Services >> Services >> Services Management >> DHCP Server >> Static Leases, added an entry like this:

[MAC Address]      [Host Name] [IP Address]    [Client Lease Time]

##:##:##:##:##:6D  www         192.168.1.156   1440

(#'s are just placeholders)

then, In the Services >> Services >> Services Management >> DHCP Server >> DNSMasq >> Additional DNSMasq Options section, I wrote the following:

address=/www/192.168.1.156

I also configured port forwarding to redirect the traffic heading to port 80, to go to the same IP address (192.168.1.156). This way, I can access www.mydomain.com in any browser in my LAN, and the page I want will be served. How can I get mydomain.com to be mapped to the same IP? this is, How can i get my page to respond to a mydomain.com request the same as a www.mydomain.com request?

I have both DNSMasq and Local DNS services enabled.

Sorry for my noob question, and thanks in advance!

share|improve this question
    
Adding the address=/www/192.168.1.156 is unnecessary. All entries added to the static leases automatically end up in the router's DNS. In fact, IIRC, this option is supposed to be given a fully qualified host name or domain, so it's likely not even working (as intended). –  Patrick Jul 31 '12 at 0:37

1 Answer 1

up vote 3 down vote accepted

The address option will accept fully qualified domain names.

address=/mydomain.com/192.168.1.156
share|improve this answer
    
I already tried your suggestion. But, godaddy already has mydomain.com mapped to an IP, so for some reason, the router doesn't override this entry... is there any other thing that is needed to be done to override external DNS's? does the rules need to be written in certain specific order?? thanks for your help! –  Throoze Jul 30 '12 at 23:39
    
@Throoze I'd suspect a typo or something similar. Order doesnt matter, and address= does override public dns. They even advertise using this feature to black-hole internet ads by doing something like address=/double-click.net/127.0.0.1. Under setup -> basic setup, do you have Use DNSMasq for DNS set? –  Patrick Jul 31 '12 at 0:35
    
@Patrick:Yes, it is set. I just tried again, and it worked! I must have skipped something the last time.... sorry, and thanks for your answer and your time! –  Throoze Jul 31 '12 at 12:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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