DNS Restore in SSH

Mister Stillwaters

New member
Joined
Feb 20, 2025
Messages
9
Things weren't working so I changed some settings. Then everything worked. Then the rest of the changes propogated and now it's all broken. I can't get to my login to access the GUI and just hit the button.

1. What is the purpose of having a hostname and domain being different (server.domain.com & domain.com)? What effect does this have on DNS?

2. Do the hostname and domain need their own DNS zones?

3. What are the DNS records required within each required zone?

4. How do I reset to default through SSH after I understand what's going wrong?
 
1.) You always need a FQDN hostname and since domain.com is not an FQDN hostname it needs to be for example server.domain.com or you can give another nice name. Try to prevent names like mail, ftp, www and such for the hostname.

2.) No, but it's better for the hostname to have it's own DNS zone, it has some benefits.

3.) The hostname dns zone is different from the domain zone, the DNS records will be created by DA itself.
Normally it's A records for ftp, mail and www, NS record for the dns server, TXT record for SPF and MX record for mail.

4.) You should always be able to get into your hosting panel, so take care of that first.
Edit the /usr/local/directadmin/conf/directadmin.conf file and change ssl=1 to ssl=0 and restart directadmin (service directadmin restart).
Then you can enter DA again via ip address like http://192.168.10.1:2222 and ofcourse change 192.168.10.1 to your own server ip.

First set your admin settings correctly again.

Once done, you can reset dns to default settings via Directadmin per user:
  1. Log in to DirectAdmin.
  2. Navigate to Server Manager.
  3. Access DNS Administration.
  4. Select the Domain.
  5. Choose Reset Defaults.
  6. Confirm the Action.
  7. Verify the Changes.
  8. Allow Time for Propagation.
Otherwise for all accounts it's in the admin panel somewhere, normally you can reach it like this.
admin/dns_admin_control.html

Remember to make a backup before messing with DNS records again. ;)
 
I was looking for a more technical answer. I already understand those general basics. Thanks though.

Also, I lost SSH access. There may have been another issue. I'm getting bombarded by hackers. Mostly BruteForce idiots, but I'm wondering if one of them got in some other way. I would assume making DNS changes shouldn't block me from going straight to my IP.
 
Hello,

I believe Richard provided as much details as requested. It is not clear which part or what question you'd like get more technical details to. Do you want to know how to modify a DNS zone file in CLI? Where are DNS files located? How to reset a DNS zone in CLI? Or what? Kindly clarify, or search the section here https://docs.directadmin.com/operation-system-level/os-general/general.html as well as others.

If you lost a SSH access, there might be numerous reasons, and we can not guess your case. So you'd provide more details and/or error text which you get when SSH'ing to your server. Is it a timeout error? A domain resolving error?

Anyway, I'd like to add my thoughts and answer your initial questions.

1. What is the purpose of having a hostname and domain being different (server.domain.com & domain.com)? What effect does this have on DNS?

Actually you can use any hostname for a server, even example.com. If you use example.com as the hostname, then directadmin might refuse to add example.com under a user account. And it is still can be bypassed. The purpose of separating domains and a hostname is to let an administrator to use all domains under a user account with or without emails and a website and avoid internal conflicts. Anyway you might refer this MEMO when choosing a hostname: https://www.rfc-editor.org/rfc/rfc8117.html A valid hostname might be required only if you plan to send public emails from your own server without using remote SMTP services. If you are not going to send emails you can use any fake or short hostname, the same is for rDNS, which for emailing purposes should match your hostname or HELO-name.


As for separating a DNS zone for a hostname, you are welcome to decide it on your own. This is not a must. But if you want Directadmin to manage it, then you'd better use a separate DNS zone for a hostname. Directadmin can operate only with a separate zone for a hostname, when it comes to creating DKIM keys. Probably it is the only case of an automation for a hostname DNS zone here.


DNS records required for a DNS zone are defined by common internet standards, DirectAdmin does not add anything new here.


As for resetting, it is not clear what you want to reset? A DNS zone? A Directadmin installation? A server?
 
Also, I lost SSH access.
You didn't mention that before, but if hackers got into it, then they could also block you.
Since you understand the general basics, then you should also know that first thing to do is take care to get SSH access again and check if the system is compromised.
This should normally be possible via KVM or other method from the datacenter. Unfortunately nothing else we can do for you at the moment, sorry.
I hope you will manage to fix things and hackers didn't get in and it was another cause.
 
Back
Top