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 have setup powerdns server, I'm satisfied with basic functionalities.

users in my domain are unable to access example.com unless they use www.example.com

when I use host command

 host example.com 127.0.0.1

I get

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> @localhost example.com
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45277
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;example.com.INA

;; AUTHORITY SECTION:
example.com.300INSOAdns.example.com. hostmaster.example.com. 1 86400 86400 604800 300

;; Query time: 2 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Jan 29 11:06:15 2013
;; MSG SIZE  rcvd: 80

the query doesn't return server ip only when I use www.example.com or ftp.example.com is there is a work around for this?

Thanks

share|improve this question
    
Well, do you have a record for @ in the zone file? –  Mathias R. Jessen Jan 29 '13 at 16:22
    
no I don't @ and it should point to my server IP? –  user1007727 Jan 29 '13 at 16:32
    
I have added @ with type "A" to point to my server IP, and it didn't make any difference. –  user1007727 Jan 29 '13 at 16:36
    
If the suggestions here and in the first answer below don't help, you need to show us a lot more. Please include pdns.conf and any referenced files, and any relevant database dumps. –  Habbie Feb 5 '13 at 13:29

3 Answers 3

What you need is a root zone record. It is usually denoted @ and must be a host record, CNAME's can not be used

@ references the zone name itself, so if you need to resolve example.com you need a record named @ in the root of the zone example.com

share|improve this answer
    
unfortunately this didn't resolve my issue, I have added @ type A record and point to my server's IP address. but it is still giving me same host or dig results. –  user1007727 Jan 29 '13 at 18:10
up vote 1 down vote accepted

OKay, I have found a solution, if you are using a nice UI such as (PowerDNS Webinterface) to manage your powerDNS server, you need to create an "empty" A record pointing to your IP address

example

  1. Add new record.
  2. Under value section "leave it empty" this will resemble the @ root zone file and have it point to your DNS IP address.
share|improve this answer

You did not specify which PowerDNS backend you used.

The @ syntax as mentioned by several people here does only work with the bind backend that uses BIND-style zonefiles.

If you used for example gmysql as a backend you would need to create a record by the name of "example.com" and the IP address you want it to point to as the content.

share|improve this answer

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.