In FreeBSD there is a file named ‘resolv.conf’ where the dns servers are located.
If you want to add an extra DNS server you have to edit this file.
Log in with root.
# ee /etc/resolv.conf
You will probably see something like:
To add an extra nameserver, all you have to do is add an extra nameserver.
Your file will look like this:
This entry was posted in
FreeBSD and tagged add dns freebsd, add extra dns, add nameserver freebsd, change dns freebsd, change nameserver freebsd, conf freebsd, dns, etc/resolv.conf, etc/resolv.conf freebsd, nameserver, resolv, resolv.conf on . September 23, 2013
When you try to update your ports tree by running the command:
# portsnap fetch update
After some files you will get a error message:
snapshot is corrupt
This is probably due the fact that the portsnap fetch update command hasnt been executed for some time,
and that it needs to get a lot of updates.
# rm /var/db/portsnap/tag && portsnap fetch extract
This will download a complete new ports tree.
How to Change Directory (cd) to a folder with space(s) in the name.
cd foldername with spaces
cd foldername: No such file or directory
now use ” ”
cd “foldername with spaces”
To update the ports collection in FreeBSD you need to execute the following commands”
If you have never used ‘portsnap’ before type:
# portsnap fetch
The ports collection will now be downloaded.
# portsnap extract
The collection is being extracted.
To update the collection type:
# portsnap update
When you’ve created a script and you want to ‘run’ it for example every 5minutes on your webserver you can create an cronjob.
But when the cronjob should launch your script, nothing happens and when you run it manually on the server it does work.
There is a simple solution for this.
Cron can only handle ‘full paths’ if for example you have in your script:
rsync ……. it wont work via cron, you have to put it in your script like this:
So use full paths!
When your FreeBSD machines comes with the message ‘enter full pathname of shell or return’ there is a simple solution:
Log in with root.
# fsck -y
The machine will now try to fixx itself.
If you lost / forgot your MySQL password you can restore it by connecting to the host with SSH.
Next you add the following line to you /etc/rc.conf.
Then restart MySQL
# /usr/local/etc/rc.d/mysql-server restart
Connect with MySQL
# mysql -u root mysql
Then type the below command:
UPDATE mysql.user SET Password=PASSWORD(‘new password’) WHERE USER=’root’;
Now remove the line you added from rc.conf and restart mysql once again.
You will now be able to access mysql / phpmyadmin