# Set up BIND DNS, how am I sure it is working



## contraversy (Apr 30, 2012)

I followed a detailed DNS BIND setup tutorial. *V*ery lengthy, at the end it said to dig google.com and if the third line from the bottom had my router*'*s IP listed then it worked*.*

*W*ell the third line from the bottom was*:*

```
;;SERVER: 192.168.2.1#53(192.168.2.1)
```
*T*hat*'*s my router*'*s IP, and *I* can also ping other websites*,* so my net is working*.*

*S*o *I* went to godaddy.com and purchased my domain http://www.mydomain.com and *I* went and forwarded it to my internet*'*s IP address (said it can take 24-48 hours to forward).

*I* set up my .conf files as users.mydomain.com but godaddy.com didn*'*t give me any options to create the 'users' prefix so *I'm* assuming BIND handles all of this.

Is my next step to try and ssh users.mydomain.com after it forwards? *B*ecause as of now my ssh logins do not work for any of my outside users, when *I* connect via my IP address the connection is refused and won*'*t let anyone get to the login: screen

*A*lso when *I* type `/etc/rc.d/named start` it errors and says to make 
	
	



```
named_enable="YES"
```
 in my configuration file but it*'*s already in there, so it must already be running from boot up*.*


----------



## inky (May 24, 2012)

Hello, seems you don't have 
	
	



```
named_enable="YES"
```
 in /etc/rc.conf.


----------



## redw0lfx (May 25, 2012)

*For SSH:*


			
				contraversy said:
			
		

> Is my next step to try and ssh users.mydomain.com after it forwards? *B*ecause as of now my ssh logins do not work for any of my outside users, when *I* connect via my IP address the connection is refused and won*'*t let anyone get to the login: screen



Did you enable port forwarding on your firewall?  If you attempted to connect to port 22 via your IP address, example, 1.2.3.4, and that was denied, it means you most likely have not configured your firewall correctly.

*For DNS:*
To verify that your DNS is working correctly, you can do (replace users.mydomain.com with your correct domain):

[CMD=""]dig @8.8.8.8 users.mydomain.com[/CMD]

And should get an output similar to whats below, which means your DNS server is working and other DNS servers can query yours for the information it needs.


```
; <<>> DiG 9.8.1-P1 <<>> @8.8.8.8 mydomain.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56882
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mydomain.com.			IN	A

;; ANSWER SECTION:
mydomain.com.		170	IN	A	65.254.242.180

;; Query time: 23 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu May 24 17:55:51 2012
;; MSG SIZE  rcvd: 46
```

If you do not get an IP address in the ANSWER SECTION, you most likely have your DNS settings incorrect, or need to forward UDP port 53 to your DNS server.


----------

